From 2cc26634340c91571d35660563e318151efef661 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Mon, 10 Sep 2018 11:58:08 +0100 Subject: [PATCH] gnetworkmonitornetlink: Don't check if a passed-in GError ** is NULL This is not a correct way to check if `g_socket_new_from_fd()` failed. Instead just see if it returned `NULL` itself. This was preventing the netlink monitor from being initialised. Closes #1518 --- gio/gnetworkmonitornetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c index b308b3b65..f889a3b64 100644 --- a/gio/gnetworkmonitornetlink.c +++ b/gio/gnetworkmonitornetlink.c @@ -113,7 +113,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable, } nl->priv->sock = g_socket_new_from_fd (sockfd, error); - if (error) + if (!nl->priv->sock) { g_prefix_error (error, "%s", _("Could not create network monitor: ")); (void) g_close (sockfd, NULL);