diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-03-22 21:50:12 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-03-22 22:57:09 +0100 |
| commit | 443eb4e9506026094f5e0dadc3e11d3cf7a86a24 (patch) | |
| tree | 65aaa990b06517dcb1a1d5a89b2856f7ef78e460 /tests/utils.scm | |
| parent | ca534666aa18405c96f661fd108686f2ae72c9aa (diff) | |
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.
Diffstat (limited to 'tests/utils.scm')
| -rw-r--r-- | tests/utils.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm index adac5d43815..85daa3db919 100644 --- a/tests/utils.scm +++ b/tests/utils.scm | |||
| @@ -142,6 +142,14 @@ | |||
| 142 | (append pids1 pids2))) | 142 | (append pids1 pids2))) |
| 143 | (equal? (get-bytevector-all decompressed) data))))) | 143 | (equal? (get-bytevector-all decompressed) data))))) |
| 144 | 144 | ||
| 145 | (test-assert "filtered-port, does not exist" | ||
| 146 | (let* ((file (search-path %load-path "guix.scm")) | ||
| 147 | (input (open-file file "r0b"))) | ||
| 148 | (let-values (((port pids) | ||
| 149 | (filtered-port '("/does/not/exist") input))) | ||
| 150 | (any (compose (negate zero?) cdr waitpid) | ||
| 151 | pids)))) | ||
| 152 | |||
| 145 | (false-if-exception (delete-file temp-file)) | 153 | (false-if-exception (delete-file temp-file)) |
| 146 | (test-equal "fcntl-flock wait" | 154 | (test-equal "fcntl-flock wait" |
| 147 | 42 ; the child's exit status | 155 | 42 ; the child's exit status |
