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
This commit is contained in:
Iain Lane 2018-09-10 11:58:08 +01:00 committed by Philip Withnall
parent 96e8e03a57
commit 2cc2663434

View File

@ -113,7 +113,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
} }
nl->priv->sock = g_socket_new_from_fd (sockfd, error); 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: ")); g_prefix_error (error, "%s", _("Could not create network monitor: "));
(void) g_close (sockfd, NULL); (void) g_close (sockfd, NULL);