1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

Fixed sys_lseek and seek_file calls so all returns

are *checked* :-).
Jeremy.
(This used to be commit b8b781191d)
This commit is contained in:
Jeremy Allison
1998-10-18 22:06:35 +00:00
parent 691e2f245c
commit b8aec499dc
6 changed files with 308 additions and 186 deletions

View File

@ -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
}