2006-12-17 Matthias Clasen <mclasen@redhat.com>
+ * glib/gspawn.c: Fix the recent fdwalk()-related changes
+ to not break mapping-test. (#286838, Marco Barisione)
+
* glib/gstring.c (g_string_chunk_new): Don't shadow size.
(#386760, Kazuki IWAMOTO)
_exit (1);
}
-static void
+static int
set_cloexec (void *data, gint fd)
{
- if (fd > 2)
+ if (fd >= GPOINTER_TO_INT (data))
fcntl (fd, F_SETFD, FD_CLOEXEC);
+
+ return 0;
}
#ifndef HAVE_FDWALK
*/
if (close_descriptors)
{
- fdwalk (set_cloexec, NULL);
+ fdwalk (set_cloexec, GINT_TO_POINTER(3));
}
else
{
/* We need to do child_err_report_fd anyway */
- set_cloexec (NULL, child_err_report_fd);
+ set_cloexec (GINT_TO_POINTER(0), child_err_report_fd);
}
/* Redirect pipes as required */