mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 13:10:33 +02:00
utils: 'filtered-port' doesn't leave dangling processes behind.
* guix/utils.scm (filtered-port): Make sure the 'execl' child process
always exits, and does (primitive-_exit 1) upon execution failure.
Use 'primitive-_exit' in the 'dump-port' child process.
* tests/utils.scm ("filtered-port, does not exist"): New test.
This commit is contained in:
@@ -142,6 +142,14 @@
|
||||
(append pids1 pids2)))
|
||||
(equal? (get-bytevector-all decompressed) data)))))
|
||||
|
||||
(test-assert "filtered-port, does not exist"
|
||||
(let* ((file (search-path %load-path "guix.scm"))
|
||||
(input (open-file file "r0b")))
|
||||
(let-values (((port pids)
|
||||
(filtered-port '("/does/not/exist") input)))
|
||||
(any (compose (negate zero?) cdr waitpid)
|
||||
pids))))
|
||||
|
||||
(false-if-exception (delete-file temp-file))
|
||||
(test-equal "fcntl-flock wait"
|
||||
42 ; the child's exit status
|
||||
|
||||
Reference in New Issue
Block a user