diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2012-07-20 17:06:12 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2012-07-31 11:59:37 +0200 |
commit | 584c90ed0861440fd052a6090d132dd0859efd0d (patch) | |
tree | 2c58cd6bfb92f466bf99a698923ac7b755f340f3 /client | |
parent | 6f16f975afa7da91291bd6a0ab30d16823951dde (diff) |
gdbus: Use G_VARIANT_TYPE_HANDLE for fd_id arguments
Diffstat (limited to 'client')
-rw-r--r-- | client/gdaemonfile.c | 24 | ||||
-rw-r--r-- | client/gvfsiconloadable.c | 12 |
2 files changed, 30 insertions, 6 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index de73e16c..7acc2c9c 100644 --- a/client/gdaemonfile.c +++ b/client/gdaemonfile.c @@ -1040,18 +1040,22 @@ read_async_cb (GVfsDBusMount *proxy, gboolean can_seek; GUnixFDList *fd_list; int fd; + GVariant *fd_id_val; guint fd_id; GFileInputStream *stream; g_print ("read_async_cb\n"); orig_result = data->result; - if (! gvfs_dbus_mount_call_open_for_read_finish (proxy, &fd_id, &can_seek, &fd_list, res, &error)) + if (! gvfs_dbus_mount_call_open_for_read_finish (proxy, &fd_id_val, &can_seek, &fd_list, res, &error)) { g_simple_async_result_take_error (orig_result, error); goto out; } + fd_id = g_variant_get_handle (fd_id_val); + g_variant_unref (fd_id_val); + if (fd_list == NULL || g_unix_fd_list_get_length (fd_list) != 1 || (fd = g_unix_fd_list_get (fd_list, fd_id, NULL)) == -1) { @@ -1152,6 +1156,7 @@ g_daemon_file_read (GFile *file, gboolean can_seek; GUnixFDList *fd_list; int fd; + GVariant *fd_id_val; guint fd_id; guint32 pid; GError *local_error = NULL; @@ -1168,7 +1173,7 @@ g_daemon_file_read (GFile *file, path, pid, NULL, - &fd_id, + &fd_id_val, &can_seek, &fd_list, cancellable, @@ -1176,6 +1181,9 @@ g_daemon_file_read (GFile *file, g_print ("g_daemon_file_read: done, res = %d\n", res); + fd_id = g_variant_get_handle (fd_id_val); + g_variant_unref (fd_id_val); + if (! res) { if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -1217,6 +1225,7 @@ file_open_write (GFile *file, gboolean can_seek; GUnixFDList *fd_list; int fd; + GVariant *fd_id_val; guint32 fd_id; guint32 pid; guint64 initial_offset; @@ -1239,7 +1248,7 @@ file_open_write (GFile *file, flags, pid, NULL, - &fd_id, + &fd_id_val, &can_seek, &initial_offset, &fd_list, @@ -1248,6 +1257,9 @@ file_open_write (GFile *file, g_print ("file_open_write: done, res = %d\n", res); + fd_id = g_variant_get_handle (fd_id_val); + g_variant_unref (fd_id_val); + if (! res) { if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -3201,6 +3213,7 @@ file_open_write_async_cb (GVfsDBusMount *proxy, gboolean can_seek; GUnixFDList *fd_list; int fd; + GVariant *fd_id_val; guint fd_id; guint64 initial_offset; GFileOutputStream *output_stream; @@ -3208,12 +3221,15 @@ file_open_write_async_cb (GVfsDBusMount *proxy, g_print ("file_open_write_async_cb\n"); orig_result = data->result; - if (! gvfs_dbus_mount_call_open_for_write_finish (proxy, &fd_id, &can_seek, &initial_offset, &fd_list, res, &error)) + if (! gvfs_dbus_mount_call_open_for_write_finish (proxy, &fd_id_val, &can_seek, &initial_offset, &fd_list, res, &error)) { g_simple_async_result_take_error (orig_result, error); goto out; } + fd_id = g_variant_get_handle (fd_id_val); + g_variant_unref (fd_id_val); + if (fd_list == NULL || g_unix_fd_list_get_length (fd_list) != 1 || (fd = g_unix_fd_list_get (fd_list, fd_id, NULL)) == -1) { diff --git a/client/gvfsiconloadable.c b/client/gvfsiconloadable.c index b639adfb..987bdbc6 100644 --- a/client/gvfsiconloadable.c +++ b/client/gvfsiconloadable.c @@ -91,6 +91,7 @@ g_vfs_icon_load (GLoadableIcon *icon, gboolean can_seek; GUnixFDList *fd_list; int fd; + GVariant *fd_id_val; guint32 fd_id; GError *local_error = NULL; @@ -103,7 +104,7 @@ g_vfs_icon_load (GLoadableIcon *icon, res = gvfs_dbus_mount_call_open_icon_for_read_sync (proxy, vfs_icon->icon_id, NULL, - &fd_id, + &fd_id_val, &can_seek, &fd_list, cancellable, @@ -111,6 +112,9 @@ g_vfs_icon_load (GLoadableIcon *icon, g_print ("gvfsiconloadable.c: g_vfs_icon_load: done, res = %d\n", res); + fd_id = g_variant_get_handle (fd_id_val); + g_variant_unref (fd_id_val); + if (! res) { if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -290,17 +294,21 @@ open_icon_read_cb (GVfsDBusMount *proxy, gboolean can_seek; GUnixFDList *fd_list; int fd; + GVariant *fd_id_val; guint fd_id; GFileInputStream *stream; g_print ("gvfsiconloadable.c: open_icon_read_cb\n"); - if (! gvfs_dbus_mount_call_open_icon_for_read_finish (proxy, &fd_id, &can_seek, &fd_list, res, &error)) + if (! gvfs_dbus_mount_call_open_icon_for_read_finish (proxy, &fd_id_val, &can_seek, &fd_list, res, &error)) { g_simple_async_result_take_error (data->result, error); goto out; } + fd_id = g_variant_get_handle (fd_id_val); + g_variant_unref (fd_id_val); + if (fd_list == NULL || g_unix_fd_list_get_length (fd_list) != 1 || (fd = g_unix_fd_list_get (fd_list, fd_id, NULL)) == -1) { |