glib-unix.c: Don't leak FDs if pipe2() succeeds

This commit is contained in:
Colin Walters 2011-05-03 16:22:13 -04:00
parent e5c986cbcf
commit 511070fb28

View File

@ -111,6 +111,8 @@ g_unix_pipe_flags (int *fds,
ecode = pipe2 (fds, pipe2_flags); ecode = pipe2 (fds, pipe2_flags);
if (ecode == -1 && errno != ENOSYS) if (ecode == -1 && errno != ENOSYS)
return g_unix_set_error_from_errno (error); return g_unix_set_error_from_errno (error);
else if (ecode == 0)
return TRUE;
/* Fall through on -ENOSYS, we must be running on an old kernel */ /* Fall through on -ENOSYS, we must be running on an old kernel */
} }
#endif #endif