summaryrefslogtreecommitdiff
path: root/client/gdaemonfileoutputstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'client/gdaemonfileoutputstream.c')
-rw-r--r--client/gdaemonfileoutputstream.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/client/gdaemonfileoutputstream.c b/client/gdaemonfileoutputstream.c
index 1412a6a1..288616dc 100644
--- a/client/gdaemonfileoutputstream.c
+++ b/client/gdaemonfileoutputstream.c
@@ -560,14 +560,8 @@ g_daemon_file_output_stream_write (GOutputStream *stream,
file = G_DAEMON_FILE_OUTPUT_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_WRITE_SIZE)
@@ -927,14 +921,8 @@ g_daemon_file_output_stream_seek (GFileOutputStream *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;