mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
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.
This commit is contained in:
parent
a41b07a34f
commit
a43fa1b706
1 changed files with 5 additions and 7 deletions
|
@ -1345,23 +1345,21 @@ scm_open_process (SCM mode, SCM prog, SCM args)
|
||||||
SCM read_port = SCM_BOOL_F, write_port = SCM_BOOL_F;
|
SCM read_port = SCM_BOOL_F, write_port = SCM_BOOL_F;
|
||||||
|
|
||||||
/* There is no sense in catching errors on close(). */
|
/* There is no sense in catching errors on close(). */
|
||||||
if (reading)
|
if (reading)
|
||||||
{
|
{
|
||||||
close (c2p[1]);
|
close (c2p[1]);
|
||||||
read_port = scm_fdes_to_port (c2p[0], "r", sym_read_pipe);
|
read_port = scm_fdes_to_port (c2p[0], "r0", sym_read_pipe);
|
||||||
scm_setvbuf (read_port, scm_from_int (_IONBF), SCM_UNDEFINED);
|
|
||||||
}
|
}
|
||||||
if (writing)
|
if (writing)
|
||||||
{
|
{
|
||||||
close (p2c[0]);
|
close (p2c[0]);
|
||||||
write_port = scm_fdes_to_port (p2c[1], "w", sym_write_pipe);
|
write_port = scm_fdes_to_port (p2c[1], "w0", sym_write_pipe);
|
||||||
scm_setvbuf (write_port, scm_from_int (_IONBF), SCM_UNDEFINED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return scm_values
|
return scm_values
|
||||||
(scm_list_3 (read_port, write_port, scm_from_int (pid)));
|
(scm_list_3 (read_port, write_port, scm_from_int (pid)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The child. */
|
/* The child. */
|
||||||
if (reading)
|
if (reading)
|
||||||
close (c2p[0]);
|
close (c2p[0]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue