summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Volf <~@wolfsden.cz>2024-08-10 00:54:35 +0200
committerLudovic Courtès <ludo@gnu.org>2024-10-20 21:22:23 +0200
commit0175343deb617e9db4bd019f4108d6690de9b919 (patch)
treea4ffdd08a6bcc19730ff10e43cfdff2810d70a59
parentff256c356be9327c24a2d7fc0f007722422e6604 (diff)
downloadguile-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.c2
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)