summaryrefslogtreecommitdiffstats
path: root/source3/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
commitb8aec499dc49b1d86d9f44296e07d40232813642 (patch)
tree014e4b1eaa634570a351bec6e1baad272f37fc07 /source3/lib
parent691e2f245c7ac01b027e7300aa7fd2b1ccc90876 (diff)
downloadsamba-b8aec499dc49b1d86d9f44296e07d40232813642.tar.gz
samba-b8aec499dc49b1d86d9f44296e07d40232813642.tar.xz
samba-b8aec499dc49b1d86d9f44296e07d40232813642.zip
Fixed sys_lseek and seek_file calls so all returns
are *checked* :-). Jeremy. (This used to be commit b8b781191dd7d28944d87eec5fa0fbef798e289b)
Diffstat (limited to 'source3/lib')
-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 d0cb51f3caa..8660e22e577 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
}