Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index e4b3dd2f3..c3c17d604 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -3000,6 +3000,8 @@ posix_fallocate (int fd, off_t offset, off_t len)
res = cfd->ftruncate (offset + len, false);
else
res = EBADF;
+ if (res == EISDIR)
+ res = ENODEV;
}
syscall_printf ("%R = posix_fallocate(%d, %D, %D)", res, fd, offset, len);
return res;
@@ -3015,6 +3017,8 @@ ftruncate (int fd, off_t length)
res = cfd->ftruncate (length, true);
if (res)
{
+ if (res == ENODEV)
+ res = EINVAL;
set_errno (res);
res = -1;
}