bug#52835: [PATCH v4 1/4] Fix child spawning closing standard fds prematurely.

2022-05-28 Thread Bug reports for GUILE, GNU's Ubiquitous Extension Language
* libguile/posix.c (renumber_file_descriptor): Refactor it as dup_handle_error. (dup_handle_error, dup2_handle_error): New functions that wrap around dup and dup2 by retrying on EINTR or EBUSY, as well as erroring out on other errors. (start_child): Close standard file descriptors only after all of

bug#52835: [PATCH v4 2/4] Avoid double closes in piped-process.

2022-05-28 Thread Bug reports for GUILE, GNU's Ubiquitous Extension Language
* libguile/posix.c (scm_piped_process): Avoid double closes. --- libguile/posix.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libguile/posix.c b/libguile/posix.c index e9f49fa27..155ad09b7 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1475,12 +147

bug#52835: [PATCH v4 3/4] Remove useless closing code in start_child.

2022-05-28 Thread Bug reports for GUILE, GNU's Ubiquitous Extension Language
* libguile/posix.c (start_child): We're closing all fds anyway, no need to try to close some specific ones beforehand. --- libguile/posix.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/libguile/posix.c b/libguile/posix.c index 155ad09b7..94a043cca 100644 --- a/libguile/posix.c +++ b/li

bug#52835: [PATCH v4 4/4] Make start_child propagate the child errno to the parent.

2022-05-28 Thread Bug reports for GUILE, GNU's Ubiquitous Extension Language
* configure.ac: Add AC_CHECK_FUNCS for pipe2. * libguile/posix.c (start_child): Use a pipe to transmit the child's errno to the parent, which can then use it to signal an error instead of writing to its error file descriptor. This also avoids the use of async-signal unsafe functions inside the chi

bug#52835: [PATCH v4 0/4] Improve safety of start_child and piped-process.

2022-05-28 Thread Bug reports for GUILE, GNU's Ubiquitous Extension Language
retitle 52835 Improve safety of start_child and piped-process. thanks Hello everyone, This time, it's another Guix bug [1] that prompted me to have a closer look at piped-process and start_child, which don't seem to be very multi-thread safe. I've ended up with a couple of improvements that IMO