summaryrefslogtreecommitdiff
path: root/daemon/gvfsjobseekwrite.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 13:57:50 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 13:57:50 +0000
commitb3d92ba9a95013d985efd58cf1dbb2a61cc718b0 (patch)
tree4f680ce98ef073f5b740b1cdd3e7ca3cf40b19a2 /daemon/gvfsjobseekwrite.c
parent2c4aa53f53174bddaeafce332c709a4e0869275d (diff)
downloadgvfs-b3d92ba9a95013d985efd58cf1dbb2a61cc718b0.tar.gz
Check for unsupported operations and return error instead of crashing,
Original git commit by Alexander Larsson <alexl@redhat.com> at 1183457271 +0200 svn path=/trunk/; revision=604
Diffstat (limited to 'daemon/gvfsjobseekwrite.c')
-rw-r--r--daemon/gvfsjobseekwrite.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gvfsjobseekwrite.c b/daemon/gvfsjobseekwrite.c
index 835c76f2..75980af0 100644
--- a/daemon/gvfsjobseekwrite.c
+++ b/daemon/gvfsjobseekwrite.c
@@ -91,6 +91,13 @@ run (GVfsJob *job)
GVfsJobSeekWrite *op_job = G_VFS_JOB_SEEK_WRITE (job);
GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend);
+ if (class->seek_on_write == NULL)
+ {
+ g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported by backend"));
+ return;
+ }
+
class->seek_on_write (op_job->backend,
op_job,
op_job->handle,