diff --git a/ChangeLog b/ChangeLog index 7bcf6d097..a8154bde6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-14 Dan Williams + + * 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 + 2008-08-13 Dan Williams * callouts/nm-dispatcher-action.c diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index a07f9573c..7db406332 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -291,7 +291,7 @@ constructor (GType type, 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); } diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 2d16f4136..0e9c87294 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -434,7 +434,10 @@ nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, /* 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; } diff --git a/src/nm-netlink-monitor.h b/src/nm-netlink-monitor.h index 46497a958..a74b763a0 100644 --- a/src/nm-netlink-monitor.h +++ b/src/nm-netlink-monitor.h @@ -43,6 +43,7 @@ typedef enum { 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 {