+2004-11-08 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gmain.c: Initialize child_watch_count to 1, so
+ that we don't miss the very first child if it exits
+ before we set up the child watch. In that case we had
+ previously source->count == child_watch_count == 0,
+ causing g_child_watch_check() to skip the waitpid()
+ call. (#154827, Gustavo Carneiro)
+
+ * glib/gmain.c (g_child_watch_source_init_single)
+ (g_child_watch_source_init_multi_threaded): Use sigaction()
+ instead of signal(). (#136867, Jonas Jonsson, patch by
+ Archana Shah)
+
2004-11-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_any_init): Work around an bug
+2004-11-08 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gmain.c: Initialize child_watch_count to 1, so
+ that we don't miss the very first child if it exits
+ before we set up the child watch. In that case we had
+ previously source->count == child_watch_count == 0,
+ causing g_child_watch_check() to skip the waitpid()
+ call. (#154827, Gustavo Carneiro)
+
+ * glib/gmain.c (g_child_watch_source_init_single)
+ (g_child_watch_source_init_multi_threaded): Use sigaction()
+ instead of signal(). (#136867, Jonas Jonsson, patch by
+ Archana Shah)
+
2004-11-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_any_init): Work around an bug
+2004-11-08 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gmain.c: Initialize child_watch_count to 1, so
+ that we don't miss the very first child if it exits
+ before we set up the child watch. In that case we had
+ previously source->count == child_watch_count == 0,
+ causing g_child_watch_check() to skip the waitpid()
+ call. (#154827, Gustavo Carneiro)
+
+ * glib/gmain.c (g_child_watch_source_init_single)
+ (g_child_watch_source_init_multi_threaded): Use sigaction()
+ instead of signal(). (#136867, Jonas Jonsson, patch by
+ Archana Shah)
+
2004-11-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_any_init): Work around an bug
+2004-11-08 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gmain.c: Initialize child_watch_count to 1, so
+ that we don't miss the very first child if it exits
+ before we set up the child watch. In that case we had
+ previously source->count == child_watch_count == 0,
+ causing g_child_watch_check() to skip the waitpid()
+ call. (#154827, Gustavo Carneiro)
+
+ * glib/gmain.c (g_child_watch_source_init_single)
+ (g_child_watch_source_init_multi_threaded): Use sigaction()
+ instead of signal(). (#136867, Jonas Jonsson, patch by
+ Archana Shah)
+
2004-11-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_any_init): Work around an bug
+2004-11-08 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gmain.c: Initialize child_watch_count to 1, so
+ that we don't miss the very first child if it exits
+ before we set up the child watch. In that case we had
+ previously source->count == child_watch_count == 0,
+ causing g_child_watch_check() to skip the waitpid()
+ call. (#154827, Gustavo Carneiro)
+
+ * glib/gmain.c (g_child_watch_source_init_single)
+ (g_child_watch_source_init_multi_threaded): Use sigaction()
+ instead of signal(). (#136867, Jonas Jonsson, patch by
+ Archana Shah)
+
2004-11-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_any_init): Work around an bug
CHILD_WATCH_INITIALIZED_THREADED
};
static gint child_watch_init_state = CHILD_WATCH_UNINITIALIZED;
-static gint child_watch_count = 0;
+static gint child_watch_count = 1;
static gint child_watch_wake_up_pipe[2] = {0, 0};
#endif /* !G_OS_WIN32 */
G_LOCK_DEFINE_STATIC (main_context_list);
static void
g_child_watch_source_init_single (void)
{
+ struct sigaction action;
+
g_assert (! g_thread_supported());
g_assert (child_watch_init_state == CHILD_WATCH_UNINITIALIZED);
child_watch_init_state = CHILD_WATCH_INITIALIZED_SINGLE;
- signal (SIGCHLD, g_child_watch_signal_handler);
+ action.sa_handler = g_child_watch_signal_handler;
+ sigemptyset (&action.sa_mask);
+ action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
+ sigaction (SIGCHLD, &action, NULL);
}
static gpointer
g_child_watch_source_init_multi_threaded (void)
{
GError *error = NULL;
+ struct sigaction action;
g_assert (g_thread_supported());
if (g_thread_create (child_watch_helper_thread, NULL, FALSE, &error) == NULL)
g_error ("Cannot create a thread to monitor child exit status: %s\n", error->message);
child_watch_init_state = CHILD_WATCH_INITIALIZED_THREADED;
- signal (SIGCHLD, g_child_watch_signal_handler);
+
+ action.sa_handler = g_child_watch_signal_handler;
+ sigemptyset (&action.sa_mask);
+ action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
+ sigaction (SIGCHLD, &action, NULL);
}
static void