Merge branch 'spawn-error-handling' into 'master'

gspawn: Handle error opening /dev/null

See merge request GNOME/glib!1681
This commit is contained in:
Sebastian Dröge 2020-10-07 13:48:36 +00:00
commit 6cf381ee75

View File

@ -1451,6 +1451,9 @@ do_exec (gint child_err_report_fd,
else if (stderr_to_null)
{
gint write_null = safe_open ("/dev/null", O_WRONLY);
if (write_null < 0)
write_err_and_exit (child_err_report_fd,
CHILD_DUP2_FAILED);
safe_dup2 (write_null, 2);
close_and_invalidate (&write_null);
}