* lib/pipe-safer.c (pipe_safer): Don't test HAVE_PIPE.
* modules/unistd-safer (Depends-on): Add pipe-posix.
+2020-12-24 Bruno Haible <bruno@clisp.org>
+
+ unistd-safer: Implement pipe_safer on native Windows.
+ * lib/pipe-safer.c (pipe_safer): Don't test HAVE_PIPE.
+ * modules/unistd-safer (Depends-on): Add pipe-posix.
+
2020-12-24 Bruno Haible <bruno@clisp.org>
execute: Use posix_spawn by default on native Windows.
int
pipe_safer (int fd[2])
{
-#if HAVE_PIPE
if (pipe (fd) == 0)
{
int i;
fd[i] = fd_safer (fd[i]);
if (fd[i] < 0)
{
- int e = errno;
+ int saved_errno = errno;
close (fd[1 - i]);
- errno = e;
+ errno = saved_errno;
return -1;
}
}
return 0;
}
-#else
- errno = ENOSYS;
-#endif
return -1;
}
Depends-on:
fcntl
unistd
+pipe-posix
configure.ac:
gl_UNISTD_SAFER