diff options
author | Peter Bex <peter@more-magic.net> | 2021-09-14 14:00:52 +0200 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2021-09-14 14:00:52 +0200 |
commit | e520d20700e513d69c5c83a03b48d89f4194fe63 (patch) | |
tree | 253a87c839dea567c6d9ed7d6a621ebd66427ddf | |
parent | eb97f7d4f6a6428b52f6cd24e54d3e4650f631a0 (diff) | |
download | scsh-process-master.tar.gz |
After dup(2)ing an fd into another already existing fd, we can close
the original.
-rw-r--r-- | scsh-process.scm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scsh-process.scm b/scsh-process.scm index a6d6e0b..af3586e 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -364,6 +364,7 @@ (lambda () (file-close in) (duplicate-fileno out 1) + (file-close out) (with-output-to-port (open-output-file* 1) thunk))))) (file-close out) (open-input-file* in))) @@ -377,6 +378,7 @@ perm/irgrp perm/iwgrp perm/iroth perm/iwoth)))) (duplicate-fileno fd 1) + (file-close fd) (with-output-to-port (open-output-file* 1) thunk))))) temp-file)) |