mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gnetworkmonitornetlink.c: Make the error messages less geeky
This makes several different errors have identical messages, but they're pretty much "can't happen" situations anyway. https://bugzilla.gnome.org/show_bug.cgi?id=664406
This commit is contained in:
parent
69043de3e0
commit
1f33446e1f
@ -91,7 +91,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
||||
{
|
||||
int errsv = errno;
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
||||
_("Could not create netlink socket: %s"),
|
||||
_("Could not create network monitor: %s"),
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
@ -103,7 +103,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
||||
{
|
||||
int errsv = errno;
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
||||
_("Could not bind netlink socket: %s"),
|
||||
_("Could not create network monitor: %s"),
|
||||
g_strerror (errno));
|
||||
close (sockfd);
|
||||
return FALSE;
|
||||
@ -114,7 +114,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
||||
{
|
||||
int errsv = errno;
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
||||
_("Could not set options on netlink socket: %s"),
|
||||
_("Could not create network monitor: %s"),
|
||||
g_strerror (errno));
|
||||
close (sockfd);
|
||||
return FALSE;
|
||||
@ -123,7 +123,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
||||
nl->priv->sock = g_socket_new_from_fd (sockfd, error);
|
||||
if (error)
|
||||
{
|
||||
g_prefix_error (error, "%s", _("Could not wrap netlink socket: "));
|
||||
g_prefix_error (error, "%s", _("Could not create network monitor: "));
|
||||
close (sockfd);
|
||||
return FALSE;
|
||||
}
|
||||
@ -171,7 +171,7 @@ request_dump (GNetworkMonitorNetlink *nl,
|
||||
if (g_socket_send (nl->priv->sock, buf, sizeof (buf),
|
||||
NULL, error) < 0)
|
||||
{
|
||||
g_prefix_error (error, "%s", _("Could not send netlink request: "));
|
||||
g_prefix_error (error, "%s", _("Could not get network status: "));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user