1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Use /dev/null in 'piped-process' if port is not backed by a fdes.

In Guile 3.0.9, 'system*' would no longer open /dev/null for file
descriptors 0, 1, and 2 when its 'current-input-port',
'current-output-port', or 'current-output-port' is not bound to a file
port.  This patch reinstates that behavior.

Fixes <https://bugs.gnu.org/63024>.

* libguile/posix.c (piped_process): Open /dev/null to use as in/out/err
if the corresponding port is not backed by a file descriptor.
* test-suite/tests/posix.test ("system*")["https://bugs.gnu.org/63024"]:
New test.
* NEWS: Update.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Josselin Poiret 2023-05-05 15:39:23 +02:00 committed by Ludovic Courtès
parent ccd7400fdb
commit 36fd2b4920
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 29 additions and 5 deletions

2
NEWS
View file

@ -29,6 +29,8 @@ the compiler reports it as "possibly unused".
(<https://bugs.gnu.org/61095>)
** Adjust 'spawn' test for GNU/Hurd
(<https://bugs.gnu.org/62501>)
** Fix 'system*' with non-file input/output/error port
(<https://bugs.gnu.org/63024>)
** Hashing of UTF-8 symbols with non-ASCII characters avoids corruption
(<https://bugs.gnu.org/56413>)