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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user