Commit 2b560457 authored by Daniel Drake's avatar Daniel Drake

gspawn: use sane_open() for stdin

sane_open() is used for stdout and stderr, but regular open() was being
used for stdin. Spotted by Philip Withnall.
parent 86e2b8d4
...@@ -1258,7 +1258,7 @@ do_exec (gint child_err_report_fd, ...@@ -1258,7 +1258,7 @@ do_exec (gint child_err_report_fd,
else if (!child_inherits_stdin) else if (!child_inherits_stdin)
{ {
/* Keep process from blocking on a read of stdin */ /* Keep process from blocking on a read of stdin */
gint read_null = open ("/dev/null", O_RDONLY); gint read_null = sane_open ("/dev/null", O_RDONLY);
g_assert (read_null != -1); g_assert (read_null != -1);
sane_dup2 (read_null, 0); sane_dup2 (read_null, 0);
close_and_invalidate (&read_null); close_and_invalidate (&read_null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment