Commit 984d79a0 authored by Ray Strode's avatar Ray Strode
Browse files

2005-06-18 Ray Strode <rstrode@redhat.com>

	* src/nm-netlink-monitor.c
	(nm_netlink_monitor_event_handler): check for the presence
	of either error condition not both.

	(nm_netlink_monitor_error_handler): emit error signal if
	error occurs.

	(nm_netlink_monitor_event_handler),
	(nm_netlink_monitor_error_handler),
	(nm_netlink_monitor_disconnect_handler): if an
	assertion fails disconnect the event handler to prevent
	infinite loops.

	* src/nm-netlink-monitor.h: add new error condition
	NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@719 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 292c3811
2005-06-18 Ray Strode <rstrode@redhat.com>
* src/nm-netlink-monitor.c
(nm_netlink_monitor_event_handler): check for the presence
of either error condition not both.
(nm_netlink_monitor_error_handler): emit error signal if
error occurs.
(nm_netlink_monitor_event_handler),
(nm_netlink_monitor_error_handler),
(nm_netlink_monitor_disconnect_handler): if an
assertion fails disconnect the event handler to prevent
infinite loops.
* src/nm-netlink-monitor.h: add new error condition
NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA
2005-06-18 Ray Strode <rstrode@redhat.com>
* src/nm-netlink-monitor.c
......
......@@ -576,14 +576,14 @@ nm_netlink_monitor_event_handler (GIOChannel *channel,
guint num_bytes_to_process;
struct nlmsghdr *header;
if (io_condition == NM_NETLINK_MONITOR_ERROR_CONDITIONS)
if (io_condition & NM_NETLINK_MONITOR_ERROR_CONDITIONS)
return nm_netlink_monitor_error_handler (channel, io_condition, monitor);
else if (io_condition == NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)
else if (io_condition & NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)
return nm_netlink_monitor_disconnect_handler (channel, io_condition, monitor);
g_return_val_if_fail (!(io_condition &
~(NM_NETLINK_MONITOR_EVENT_CONDITIONS)),
TRUE);
FALSE);
error = NULL;
......@@ -712,7 +712,7 @@ nm_netlink_monitor_event_handler (GIOChannel *channel,
g_free (interface_name);
}
}
g_free(received_bytes);
g_free (received_bytes);
return TRUE;
}
......@@ -722,9 +722,20 @@ nm_netlink_monitor_error_handler (GIOChannel *channel,
GIOCondition io_condition,
NmNetlinkMonitor *monitor)
{
GError *socket_error;
g_return_val_if_fail (!(io_condition &
~(NM_NETLINK_MONITOR_ERROR_CONDITIONS)),
TRUE);
FALSE);
socket_error =
g_error_new (NM_NETLINK_MONITOR_ERROR,
NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA,
_("error occured while waiting for data on socket"));
g_signal_emit (G_OBJECT (monitor),
nm_netlink_monitor_signals[ERROR],
0, socket_error);
return TRUE;
}
......@@ -736,6 +747,6 @@ nm_netlink_monitor_disconnect_handler (GIOChannel *channel,
g_return_val_if_fail (!(io_condition &
~(NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)),
TRUE);
FALSE);
return FALSE;
}
......@@ -68,6 +68,7 @@ enum _NmNetlinkMonitorError
NM_NETLINK_MONITOR_ERROR_BINDING_TO_SOCKET,
NM_NETLINK_MONITOR_ERROR_BAD_SENDER,
NM_NETLINK_MONITOR_ERROR_BAD_SOCKET_DATA,
NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA,
NM_NETLINK_MONITOR_ERROR_READING_FROM_SOCKET,
NM_NETLINK_MONITOR_ERROR_SENDING_TO_SOCKET
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment