diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-05-28 23:06:45 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-05-28 23:06:45 +0200 |
commit | a43fa1b70688b09a9eecac3c2ce8e9adea63bab6 (patch) | |
tree | 074cd8f9cc59b52b6df2309eacbe6208dc99cbb4 /libguile/posix.c | |
parent | a41b07a34f7309dccb2140ed924d7cd1c63268f9 (diff) | |
download | guile-a43fa1b70688b09a9eecac3c2ce8e9adea63bab6.tar.gz |
Slightly simplify 'scm_open_process'.
* libguile/posix.c (scm_open_process): Call 'scm_fdes_to_port' with the
'0' flag, and remove 'scm_setvbuf' calls.
Diffstat (limited to 'libguile/posix.c')
-rw-r--r-- | libguile/posix.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libguile/posix.c b/libguile/posix.c index 6a940e46f..1dcb5acbb 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1345,23 +1345,21 @@ scm_open_process (SCM mode, SCM prog, SCM args) SCM read_port = SCM_BOOL_F, write_port = SCM_BOOL_F; /* There is no sense in catching errors on close(). */ - if (reading) + if (reading) { close (c2p[1]); - read_port = scm_fdes_to_port (c2p[0], "r", sym_read_pipe); - scm_setvbuf (read_port, scm_from_int (_IONBF), SCM_UNDEFINED); + read_port = scm_fdes_to_port (c2p[0], "r0", sym_read_pipe); } if (writing) { close (p2c[0]); - write_port = scm_fdes_to_port (p2c[1], "w", sym_write_pipe); - scm_setvbuf (write_port, scm_from_int (_IONBF), SCM_UNDEFINED); + write_port = scm_fdes_to_port (p2c[1], "w0", sym_write_pipe); } - + return scm_values (scm_list_3 (read_port, write_port, scm_from_int (pid))); } - + /* The child. */ if (reading) close (c2p[0]); |