summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-08-06 19:21:23 +0000
committerJeremy Allison <jra@samba.org>2001-08-06 19:21:23 +0000
commitf8d9da99832a43907beba8e97df8f74aa488ea28 (patch)
treeb9dcb6100c797351f11d9a585029b324db8b16f7
parentac989cbe0777beb4def038ab0b552a64a0f1ba0c (diff)
downloadsamba-f8d9da99832a43907beba8e97df8f74aa488ea28.tar.gz
samba-f8d9da99832a43907beba8e97df8f74aa488ea28.tar.bz2
samba-f8d9da99832a43907beba8e97df8f74aa488ea28.zip
Fix for getting allocate_file_space to return the correct errno.
Jeremy. (This used to be commit 298595e8cb0ac4f5b5ad9a522cca79d030d7e0fc)
-rw-r--r--source3/smbd/vfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 84aa81c38c..70e0c8657b 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -357,7 +357,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_OFF_T len)
SMB_OFF_T current_len_to_write = MIN(sizeof(zero_space),len_to_write);
retlen = vfs_ops->write(fsp,fsp->fd,zero_space,current_len_to_write);
- if (retlen != current_len_to_write) {
+ if (retlen <= 0) {
/* Write fail - return to original size. */
int save_errno = errno;
fsp->conn->vfs_ops.ftruncate(fsp, fsp->fd, st.st_size);
@@ -370,7 +370,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_OFF_T len)
DEBUG(10,("vfs_allocate_file_space: file %s, grow. wrote %.0f\n",
fsp->fsp_name, (double)current_len_to_write ));
- len_to_write -= current_len_to_write;
+ len_to_write -= retlen;
}
set_filelen_write_cache(fsp, len);
}