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.
This commit is contained in:
Daniel Drake 2018-06-13 13:45:47 -06:00
parent 86e2b8d427
commit 2b560457a0

View File

@ -1258,7 +1258,7 @@ do_exec (gint child_err_report_fd,
else if (!child_inherits_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);
sane_dup2 (read_null, 0);
close_and_invalidate (&read_null);