[gvfs] smb: Set error from the errno of the correct operation
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] smb: Set error from the errno of the correct operation
- Date: Thu, 31 Oct 2013 12:38:44 +0000 (UTC)
commit 6032fe495e7de81cb27438b652644b9bd847641e
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Sun Oct 27 10:43:12 2013 +0200
smb: Set error from the errno of the correct operation
This prevents errors of the form "Error performing operation: Success"
when doing a close after a replace that tries to overwrite a file but
fails in the final rename.
https://bugzilla.gnome.org/show_bug.cgi?id=603353
daemon/gvfsbackendsmb.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 56c9179..3cad29d 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1419,7 +1419,7 @@ do_close_write (GVfsBackend *backend,
GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend);
SmbWriteHandle *handle = _handle;
struct stat stat_at_close;
- int stat_res;
+ int stat_res, errsv;
ssize_t res;
smbc_fstat_fn smbc_fstat;
smbc_close_fn smbc_close;
@@ -1452,9 +1452,8 @@ do_close_write (GVfsBackend *backend,
op_backend->smb_context, handle->backup_uri);
if (res == -1)
{
- int errsv = errno;
-
- smbc_unlink (op_backend->smb_context, handle->tmp_uri);
+ errsv = errno;
+ smbc_unlink (op_backend->smb_context, handle->tmp_uri);
g_vfs_job_failed (G_VFS_JOB (job),
G_IO_ERROR, G_IO_ERROR_CANT_CREATE_BACKUP,
_("Backup file creation failed: %s"), g_strerror (errsv));
@@ -1468,8 +1467,9 @@ do_close_write (GVfsBackend *backend,
op_backend->smb_context, handle->uri);
if (res == -1)
{
+ errsv = errno;
smbc_unlink (op_backend->smb_context, handle->tmp_uri);
- g_vfs_job_failed_from_errno (G_VFS_JOB (job), errno);
+ g_vfs_job_failed_from_errno (G_VFS_JOB (job), errsv);
goto out;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]