diff options
author | Tomas Volf <~@wolfsden.cz> | 2024-08-10 00:54:35 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-10-20 21:22:23 +0200 |
commit | 0175343deb617e9db4bd019f4108d6690de9b919 (patch) | |
tree | a4ffdd08a6bcc19730ff10e43cfdff2810d70a59 | |
parent | ff256c356be9327c24a2d7fc0f007722422e6604 (diff) | |
download | guile-0175343deb617e9db4bd019f4108d6690de9b919.tar.gz |
posix.c: Set errno when pipe2 is not available and flags provided.
If pipe2 is not available (e.g. on MacOS) and flags are set,
SCM_SYSERROR was correctly signaled, however errno was not set, so it
reported as:
Undefined error: 0
That sucks both in tests (the test is not skipped) and in actual
usage (user has no idea what went wrong).
So set errno to ENOSYS as well.
* libguile/posix.c (scm_pipe2) [!HAVE_PIPE2] <c_flags>: Set errno to
ENOSYS.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | libguile/posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libguile/posix.c b/libguile/posix.c index 9a873b5a1..0e57f012b 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -282,7 +282,7 @@ SCM_DEFINE (scm_pipe2, "pipe", 0, 1, 0, /* 'pipe2' cannot be emulated on systems that lack it: calling 'fnctl' afterwards to set the relevant flags is not equivalent because it's not atomic. */ - rv = ENOSYS; + rv = -1, errno = ENOSYS; #endif if (rv) |