summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-10-18 22:06:35 +0000
committerJeremy Allison <jra@samba.org>1998-10-18 22:06:35 +0000
commitb8b781191dd7d28944d87eec5fa0fbef798e289b (patch)
treea40b2ff81c5186985935313184f53fc38577956d /source/lib
parent20880966aafb2dbcdfbf979505a2d64a269dd9a8 (diff)
downloadsamba-b8b781191dd7d28944d87eec5fa0fbef798e289b.tar.gz
samba-b8b781191dd7d28944d87eec5fa0fbef798e289b.tar.xz
samba-b8b781191dd7d28944d87eec5fa0fbef798e289b.zip
Fixed sys_lseek and seek_file calls so all returns
are *checked* :-). Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index d0cb51f3caa..8660e22e577 100644
--- a/source/lib/util.c
+++ b/source/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
}