summaryrefslogtreecommitdiff
path: root/client/gdaemonfileinputstream.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 14:55:35 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 14:55:35 +0000
commitd8fb06582e9574ebb5fb668a4ef93f797f384314 (patch)
treef4b70992a0d215f2ef51b10cabeb53cede1bcaab /client/gdaemonfileinputstream.c
parent784bbba3f9c77b5053d25cb9fd62cf855299bd25 (diff)
downloadgvfs-d8fb06582e9574ebb5fb668a4ef93f797f384314.tar.gz
Use g_cancellable_set_error_if_cancelled
Original git commit by Alexander Larsson <alexl@redhat.com> at 1188212811 +0200 svn path=/trunk/; revision=809
Diffstat (limited to 'client/gdaemonfileinputstream.c')
-rw-r--r--client/gdaemonfileinputstream.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/client/gdaemonfileinputstream.c b/client/gdaemonfileinputstream.c
index dd7d4624..f284fccf 100644
--- a/client/gdaemonfileinputstream.c
+++ b/client/gdaemonfileinputstream.c
@@ -665,14 +665,8 @@ g_daemon_file_input_stream_read (GInputStream *stream,
file = G_DAEMON_FILE_INPUT_STREAM (stream);
- if (g_cancellable_is_cancelled (cancellable))
- {
- g_set_error (error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- _("Operation was cancelled"));
- return -1;
- }
+ if (g_cancellable_set_error_if_cancelled (cancellable, error))
+ return -1;
/* Limit for sanity and to avoid 32bit overflow */
if (count > MAX_READ_SIZE)
@@ -1167,14 +1161,8 @@ g_daemon_file_input_stream_seek (GFileInputStream *stream,
return FALSE;
}
- if (g_cancellable_is_cancelled (cancellable))
- {
- g_set_error (error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- _("Operation was cancelled"));
- return FALSE;
- }
+ if (g_cancellable_set_error_if_cancelled (cancellable, error))
+ return FALSE;
memset (&op, 0, sizeof (op));
op.state = SEEK_STATE_INIT;