summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d0cb51f3ca..8660e22e57 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3082,7 +3082,7 @@ int set_filelen(int fd, SMB_OFF_T len)
char c = 0;
SMB_OFF_T currpos = sys_lseek(fd, (SMB_OFF_T)0, SEEK_CUR);
- if(currpos < 0)
+ if(currpos == -1)
return -1;
/* Do an fstat to see if the file is longer than
the requested size (call ftruncate),
@@ -3105,7 +3105,8 @@ int set_filelen(int fd, SMB_OFF_T len)
if(write(fd, &c, 1)!=1)
return -1;
/* Seek to where we were */
- sys_lseek(fd, currpos, SEEK_SET);
+ if(sys_lseek(fd, currpos, SEEK_SET) != currpos)
+ return -1;
return 0;
#endif
}