[glib/wip/coverity-fixes] gspawn: Abort if we can't open /dev/null
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/coverity-fixes] gspawn: Abort if we can't open /dev/null
- Date: Thu, 21 Jun 2012 20:01:57 +0000 (UTC)
commit 1ef344968c5e0ead929fc928891c28e7a8dbb74f
Author: Colin Walters <walters verbum org>
Date: Thu Jun 21 15:37:39 2012 -0400
gspawn: Abort if we can't open /dev/null
glib/gspawn.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/glib/gspawn.c b/glib/gspawn.c
index bdecff2..5d8d57b 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -1099,6 +1099,7 @@ do_exec (gint child_err_report_fd,
{
/* Keep process from blocking on a read of stdin */
gint read_null = open ("/dev/null", O_RDONLY);
+ g_assert (read_null != -1);
sane_dup2 (read_null, 0);
close_and_invalidate (&read_null);
}
@@ -1117,6 +1118,7 @@ do_exec (gint child_err_report_fd,
else if (stdout_to_null)
{
gint write_null = sane_open ("/dev/null", O_WRONLY);
+ g_assert (write_null != -1);
sane_dup2 (write_null, 1);
close_and_invalidate (&write_null);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]