mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
Don't call close on invalid fds
If an fd is -1, don't call close() on it, since that leads to EBDAF and complaints from valgrind. https://bugzilla.gnome.org/show_bug.cgi?id=657593
This commit is contained in:
parent
fb94a0299b
commit
dc38967fd3
@ -1817,9 +1817,12 @@ g_test_trap_fork (guint64 usec_timeout,
|
||||
}
|
||||
}
|
||||
}
|
||||
close (stdout_pipe[0]);
|
||||
close (stderr_pipe[0]);
|
||||
close (stdtst_pipe[0]);
|
||||
if (stdout_pipe[0] != -1)
|
||||
close (stdout_pipe[0]);
|
||||
if (stderr_pipe[0] != -1)
|
||||
close (stderr_pipe[0]);
|
||||
if (stdtst_pipe[0] != -1)
|
||||
close (stdtst_pipe[0]);
|
||||
if (need_wait)
|
||||
{
|
||||
int status = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user