diff options
author | Erik M. Bray <erik.m.bray@gmail.com> | 2017-11-02 16:45:35 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2017-11-02 18:01:01 +0100 |
commit | 94854321bb79603b3adcf42093031c7e85c81e0a (patch) | |
tree | 9a0499bdf95aff378b7bf8c97bfde0840b2b0544 /winsup/cygwin/pipe.cc | |
parent | 8c8cdd9ad72b07c1edefb5264cdcb4927700e813 (diff) | |
download | newlib-94854321bb79603b3adcf42093031c7e85c81e0a.zip newlib-94854321bb79603b3adcf42093031c7e85c81e0a.tar.gz newlib-94854321bb79603b3adcf42093031c7e85c81e0a.tar.bz2 |
posix_fallocate() *returns* error codes but does not set errno
Also updates the fhandler_*::ftruncate implementations to adhere to the same
semantics. The error handling semantics of those syscalls that use
fhandler_*::ftruncate are moved to the implementations of those syscalls (
in particular ftruncate() and friends still set errno and return -1 on error
but that logic is handled in the syscall implementation).
Diffstat (limited to 'winsup/cygwin/pipe.cc')
-rw-r--r-- | winsup/cygwin/pipe.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 8738d34..f1eace6 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -171,8 +171,7 @@ fhandler_pipe::fadvise (off_t offset, off_t length, int advice) int fhandler_pipe::ftruncate (off_t length, bool allow_truncate) { - set_errno (allow_truncate ? EINVAL : ESPIPE); - return -1; + return allow_truncate ? EINVAL : ESPIPE; } char * |