bug#55441: [PATCH 1/2] Fix child spawning closing standard fds prematurely

2022-05-26 Thread Maxime Devos
Josselin Poiret via Bug reports for GNU Guix schreef op do 26-05-2022 om 22:50 [+0200]: > +  fprintf (fdopen (err, "a"), "start_child: dup failed: %s\n", msg); fdopen can fail due to out-of-memory problems, so you'll have to check the return value, or use dprintf instead which accepts a file d

bug#55441: [PATCH 1/2] Fix child spawning closing standard fds prematurely

2022-05-26 Thread Josselin Poiret via Bug reports for GNU Guix
* 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