mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
networkmonitor netlink: Fix error detection
We currently bail out of initialization if a GError has been passed
to the function, not if it has been set by the previous call.
Until recently this bug disguised errors, but since commit e0b120cc
it causes initialization to always "fail".
https://gitlab.gnome.org/GNOME/glib/issues/1523
This commit is contained in:
@@ -113,9 +113,10 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
||||
}
|
||||
|
||||
nl->priv->sock = g_socket_new_from_fd (sockfd, error);
|
||||
if (error)
|
||||
if (nl->priv->sock == NULL)
|
||||
{
|
||||
g_prefix_error (error, "%s", _("Could not create network monitor: "));
|
||||
if (error)
|
||||
g_prefix_error (error, "%s", _("Could not create network monitor: "));
|
||||
(void) g_close (sockfd, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user