From b8aec499dc49b1d86d9f44296e07d40232813642 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 18 Oct 1998 22:06:35 +0000 Subject: Fixed sys_lseek and seek_file calls so all returns are *checked* :-). Jeremy. (This used to be commit b8b781191dd7d28944d87eec5fa0fbef798e289b) --- source3/lib/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/lib/util.c') 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 } -- cgit