diff options
author | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 12:26:02 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 12:26:02 +0000 |
commit | 865a5bf84655f95e575b14c0c8f4aa33c4b84c2e (patch) | |
tree | 5cba6f2e7a60f43c0dfbda306436d029f044530c /common | |
parent | 2cc1c9b3d90465f997203468a350f59bbd685097 (diff) | |
download | gvfs-865a5bf84655f95e575b14c0c8f4aa33c4b84c2e.tar.gz |
Move from G_FILE_ERROR to G_IO_ERROR
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1174386485 +0100
svn path=/trunk/; revision=407
Diffstat (limited to 'common')
-rw-r--r-- | common/gdbusutils.c | 10 | ||||
-rw-r--r-- | common/gmountsource.c | 4 | ||||
-rw-r--r-- | common/gsysutils.c | 9 |
3 files changed, 10 insertions, 13 deletions
diff --git a/common/gdbusutils.c b/common/gdbusutils.c index b4b7af3f..710155ca 100644 --- a/common/gdbusutils.c +++ b/common/gdbusutils.c @@ -529,7 +529,6 @@ _g_error_from_dbus (DBusError *derror, GError **error) { const char *name, *end;; - char *m; GString *str; GQuark domain; int code; @@ -557,11 +556,8 @@ _g_error_from_dbus (DBusError *derror, } /* TODO: Special case other types, like DBUS_ERROR_NO_MEMORY etc? */ else - { - m = g_strdup_printf ("DBus error %s: %s", derror->name, derror->message); - g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_IO, "%s", m); - g_free (m); - } + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "DBus error %s: %s", derror->name, derror->message); } GList * @@ -1272,7 +1268,7 @@ _g_dbus_connection_call_async (DBusConnection *connection, if (pending_call == NULL) { - g_set_error (&data->io_error, G_FILE_ERROR, G_FILE_ERROR_IO, + g_set_error (&data->io_error, G_IO_ERROR, G_IO_ERROR_FAILED, "Error while getting peer-to-peer dbus connection: %s", "Connection is closed"); g_idle_add (async_call_error_at_idle, data); diff --git a/common/gmountsource.c b/common/gmountsource.c index ebcf520c..c6bc2147 100644 --- a/common/gmountsource.c +++ b/common/gmountsource.c @@ -263,7 +263,7 @@ g_mount_source_request_mount_spec (GMountSource *source, dbus_message_unref (reply); if (source->mount_spec == NULL) { - g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "No mount spec gotten from mount source"); return NULL; } @@ -297,7 +297,7 @@ request_mount_spec_reply (DBusMessage *reply, if (data->source->mount_spec == NULL) { error = NULL; - g_set_error (&error, G_FILE_ERROR, G_FILE_ERROR_INVAL, + g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "No mount spec gotten from mount source"); data->callback (data->source, NULL, error, data->user_data); g_error_free (error); diff --git a/common/gsysutils.c b/common/gsysutils.c index d9a04e85..1e25ffba 100644 --- a/common/gsysutils.c +++ b/common/gsysutils.c @@ -5,6 +5,7 @@ #include <stdio.h> #include <errno.h> #include <unistd.h> +#include <gio/gioerror.h> #include <glib/gi18n-lib.h> @@ -92,8 +93,8 @@ _g_socket_connect (const char *address, fd = socket (PF_UNIX, SOCK_STREAM, 0); if (fd == -1) { - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), + g_set_error (error, G_IO_ERROR, + g_io_error_from_errno (errno), _("Error creating socket: %s"), g_strerror (errno)); return -1; @@ -128,8 +129,8 @@ _g_socket_connect (const char *address, if (connect (fd, (struct sockaddr*) &addr, G_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0) { - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), + g_set_error (error, G_IO_ERROR, + g_io_error_from_errno (errno), _("Error connecting to socket: %s"), g_strerror (errno)); close (fd); |