mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02: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:
@@ -91,7 +91,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
|||||||
{
|
{
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
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));
|
g_strerror (errno));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
|||||||
{
|
{
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
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));
|
g_strerror (errno));
|
||||||
close (sockfd);
|
close (sockfd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -114,7 +114,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
|||||||
{
|
{
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
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));
|
g_strerror (errno));
|
||||||
close (sockfd);
|
close (sockfd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -123,7 +123,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 (error)
|
||||||
{
|
{
|
||||||
g_prefix_error (error, "%s", _("Could not wrap netlink socket: "));
|
g_prefix_error (error, "%s", _("Could not create network monitor: "));
|
||||||
close (sockfd);
|
close (sockfd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -171,7 +171,7 @@ request_dump (GNetworkMonitorNetlink *nl,
|
|||||||
if (g_socket_send (nl->priv->sock, buf, sizeof (buf),
|
if (g_socket_send (nl->priv->sock, buf, sizeof (buf),
|
||||||
NULL, error) < 0)
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user