Cygwin: fallocate(2): fix evaluating return value
fallocate is not supposed to return an errno code, it has to return -1 and set errno. Fixes: dd90ede40510 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
7f9caa4a36
commit
114f89caff
|
@ -3017,8 +3017,13 @@ fallocate (int fd, int mode, off_t offset, off_t len)
|
|||
if (res == EISDIR)
|
||||
res = ENODEV;
|
||||
}
|
||||
if (res)
|
||||
{
|
||||
set_errno (res);
|
||||
res = -1;
|
||||
}
|
||||
syscall_printf ("%R = posix_fallocate(%d, %D, %D)", res, fd, offset, len);
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
extern "C" int
|
||||
|
|
Loading…
Reference in New Issue