summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorDaniel Drake <drake@endlessm.com>2018-06-13 13:45:47 -0600
committerDaniel Drake <drake@endlessm.com>2018-06-21 11:44:59 -0500
commit2b560457a0867639ceab8d04490e0ef902470799 (patch)
treede28ba817db89d1c4a746735e3019aa2c23c4b69 /glib
parent86e2b8d427ff1ce7bf45cc032584116318f41c3f (diff)
downloadglib-2b560457a0867639ceab8d04490e0ef902470799.tar.gz
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.
Diffstat (limited to 'glib')
-rw-r--r--glib/gspawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gspawn.c b/glib/gspawn.c
index 37f7cd34b..4fe60a584 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -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);