diff -r a009a7319294 -r 72d47896d80d pidgin/gtkmain.c --- a/pidgin/gtkmain.c Wed Mar 05 17:18:09 2008 +0000 +++ b/pidgin/gtkmain.c Fri Mar 07 21:32:09 2008 +0000 @@ -100,7 +100,6 @@ SIGTERM, SIGQUIT, SIGCHLD, - SIGALRM, -1 }; @@ -141,38 +140,11 @@ #ifdef HAVE_SIGNAL_H static void sighandler(int sig); -/** - * Reap all our dead children. Sometimes libpurple forks off a separate - * process to do some stuff. When that process exits we are - * informed about it so that we can call waitpid() and let it - * stop being a zombie. - * - * We used to do this immediately when our signal handler was - * called, but because of GStreamer we now wait one second before - * reaping anything. Why? For some reason GStreamer fork()s - * during their initialization process. I don't understand why... - * but they do it, and there's nothing we can do about it. - * - * Anyway, so then GStreamer waits for its child to die and then - * it continues with the initialization process. This means that - * we have a race condition where GStreamer is waitpid()ing for its - * child to die and we're catching the SIGCHLD signal. If GStreamer - * is awarded the zombied process then everything is ok. But if libpurple - * reaps the zombie process then the GStreamer initialization sequence - * fails. - * - * So the ugly solution is to wait a second to give GStreamer time to - * reap that bad boy. - * - * GStreamer 0.10.10 and newer have a gst_register_fork_set_enabled() - * function that can be called by applications to disable forking - * during initialization. But it's not in 0.10.0, so we shouldn't - * use it. - * - * All of this child process reaping stuff is currently only used for - * processes that were forked to play sounds. It's not needed for - * forked DNS child, which have their own waitpid() call. It might - * be wise to move this code into gtksound.c. +/* + * This child process reaping stuff is currently only used for processes that + * were forked to play sounds. It's not needed for forked DNS child, which + * have their own waitpid() call. It might be wise to move this code into + * gtksound.c. */ static void clean_pid(void) @@ -189,9 +161,6 @@ snprintf(errmsg, BUFSIZ, "Warning: waitpid() returned %d", pid); perror(errmsg); } - - /* Restore signal catching */ - signal(SIGALRM, sighandler); } char *segfault_message; @@ -221,12 +190,8 @@ abort(); break; case SIGCHLD: - /* Restore signal catching */ - signal(SIGCHLD, sighandler); - alarm(1); - break; - case SIGALRM: clean_pid(); + signal(SIGCHLD, sighandler); /* restore signal catching on this one! */ break; default: purple_debug_warning("sighandler", "Caught signal %d\n", sig);