diff options
author | Dan Winship <danw@gnome.org> | 2009-11-20 11:34:50 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2009-11-20 11:34:50 -0500 |
commit | db37deb589ea6d65611fb27ab1908196ad5d1930 (patch) | |
tree | fcb6a65a3f4619065367adb60e57d7877b6c50fa /src/core/main.c | |
parent | ec7a3c516d36921d49fc757d6afae5e88731f47f (diff) | |
download | metacity-db37deb589ea6d65611fb27ab1908196ad5d1930.tar.gz |
Fix handling of SIGCHLD
The commit that removed metacity-dialog added a global SIGCHLD handler
that caused problems by (a) calling waitpid(-1) and thus breaking
g_child_watch for everyone else, and (b) doing too much from a signal
handler and sometimes causing deadlocks (bug 596200).
This removes the global handler and has each zenity user create its
own child watch to watch for exit. (It also fixes the window class of
the zenity dialogs, so that meta_window_present_delete_dialog()
will work again.)
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/core/main.c b/src/core/main.c index 509c6505..8ef856e7 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -390,29 +390,6 @@ on_sigterm (void) return FALSE; } -static guint sigchld_signal_id = 0; - -static void -sigchld_handler (int signum, siginfo_t *info, void *context) -{ - int stat; - - if (info->si_code == CLD_EXITED) - { - g_signal_emit (sigchld_nexus, sigchld_signal_id, 0, - info->si_status, - GINT_TO_POINTER (info->si_pid)); - } - - g_signal_handlers_disconnect_matched (sigchld_nexus, - G_SIGNAL_MATCH_DATA, - sigchld_signal_id, - 0, NULL, NULL, - GINT_TO_POINTER (info->si_pid)); - - waitpid (info->si_pid, &stat, WNOHANG); -} - /** * This is where the story begins. It parses commandline options and * environment variables, sets up the screen, hands control off to @@ -473,24 +450,6 @@ main (int argc, char **argv) g_printerr ("Failed to register SIGTERM handler: %s\n", g_strerror (errno)); - sigchld_nexus = g_object_new (META_TYPE_NEXUS, NULL); - - sigchld_signal_id = - g_signal_new ("sigchld", META_TYPE_NEXUS, - G_SIGNAL_RUN_LAST, - 0, NULL, NULL, - g_cclosure_marshal_VOID__UINT_POINTER, - G_TYPE_NONE, - 2, - G_TYPE_UINT, G_TYPE_POINTER); - - act.sa_flags = SA_NOCLDSTOP | SA_SIGINFO; - act.sa_handler = SIG_DFL; - act.sa_sigaction = &sigchld_handler; - if (sigaction (SIGCHLD, &act, NULL) < 0) - g_printerr ("Failed to register SIGCHLD handler: %s\n", - g_strerror (errno)); - if (g_getenv ("METACITY_VERBOSE")) meta_set_verbose (TRUE); if (g_getenv ("METACITY_DEBUG")) |