NetworkManager r3958 - in trunk: . src



Author: dcbw
Date: Thu Aug 14 15:47:26 2008
New Revision: 3958
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3958&view=rev

Log:
2008-08-14  Dan Williams  <dcbw redhat com>

	* src/nm-netlink-monitor.c
	  src/nm-netlink-monitor.h
	  src/nm-device-ethernet.c
		- (nm_netlink_monitor_request_status): return an error on failure
		- (constructor): don't segfault on missing error



Modified:
   trunk/ChangeLog
   trunk/src/nm-device-ethernet.c
   trunk/src/nm-netlink-monitor.c
   trunk/src/nm-netlink-monitor.h

Modified: trunk/src/nm-device-ethernet.c
==============================================================================
--- trunk/src/nm-device-ethernet.c	(original)
+++ trunk/src/nm-device-ethernet.c	Thu Aug 14 15:47:26 2008
@@ -291,7 +291,7 @@
 											  dev);
 
 		if (!nm_netlink_monitor_request_status (monitor, &error)) {
-			nm_warning ("couldn't request carrier state: %s", error->message);
+			nm_warning ("couldn't request carrier state: %s", error ? error->message : "unknown");
 			g_error_free (error);
 		}
 

Modified: trunk/src/nm-netlink-monitor.c
==============================================================================
--- trunk/src/nm-netlink-monitor.c	(original)
+++ trunk/src/nm-netlink-monitor.c	Thu Aug 14 15:47:26 2008
@@ -434,7 +434,10 @@
 
 	/* Update the link cache with latest state */
 	if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) {
-		nm_warning ("Error updating link cache: %s", nl_geterror ());
+		g_set_error (error, NM_NETLINK_MONITOR_ERROR,
+		             NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE,
+		             _("error updating link cache: %s"),
+		             nl_geterror ());
 		return FALSE;
 	}
 

Modified: trunk/src/nm-netlink-monitor.h
==============================================================================
--- trunk/src/nm-netlink-monitor.h	(original)
+++ trunk/src/nm-netlink-monitor.h	Thu Aug 14 15:47:26 2008
@@ -43,6 +43,7 @@
 	NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE,
 	NM_NETLINK_MONITOR_ERROR_BAD_ALLOC,
 	NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA,
+	NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE
 } NMNetlinkMonitorError;
 
 typedef struct {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]