summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs-wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r--source3/smbd/vfs-wrap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index 1d94e18e5b..fadc435a2f 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -164,11 +164,13 @@ ssize_t vfswrap_write(files_struct *fsp, int fd, const void *data, size_t n)
SMB_OFF_T vfswrap_lseek(files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
{
- SMB_OFF_T result;
+ SMB_OFF_T result = 0;
START_PROFILE(syscall_lseek);
- result = sys_lseek(filedes, offset, whence);
+ /* Cope with 'stat' file opens. */
+ if (filedes != -1)
+ result = sys_lseek(filedes, offset, whence);
/*
* We want to maintain the fiction that we can seek