mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 04:40:29 +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:
parent
ccd7400fdb
commit
36fd2b4920
3 changed files with 29 additions and 5 deletions
|
@ -374,7 +374,17 @@
|
|||
(system* "sh" "-c" "echo bong >&2"))))))))
|
||||
|
||||
(and (zero? (status:exit-val status))
|
||||
(call-with-input-file file get-string-all)))))
|
||||
(call-with-input-file file get-string-all))))
|
||||
|
||||
(pass-if-equal "https://bugs.gnu.org/63024"
|
||||
0
|
||||
(if (file-exists? "/proc/self/fd/0") ;on GNU/Linux?
|
||||
(parameterize ((current-output-port (%make-void-port "w0")))
|
||||
(system* "guile" "-c"
|
||||
(object->string
|
||||
'(exit (string=? "/dev/null"
|
||||
(readlink "/proc/self/fd/1"))))))
|
||||
(throw 'unresolved))))
|
||||
|
||||
;;
|
||||
;; spawn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue