From: <sea...@us...> - 2006-09-11 21:07:37
|
Revision: 17254 http://svn.sourceforge.net/gaim/?rev=17254&view=rev Author: seanegan Date: 2006-09-11 14:07:32 -0700 (Mon, 11 Sep 2006) Log Message: ----------- The Glib timeout was causing reentrency issues, so I reimplemented it with alarm() Modified Paths: -------------- trunk/gtk/gtkmain.c Modified: trunk/gtk/gtkmain.c =================================================================== --- trunk/gtk/gtkmain.c 2006-09-11 18:34:36 UTC (rev 17253) +++ trunk/gtk/gtkmain.c 2006-09-11 21:07:32 UTC (rev 17254) @@ -89,7 +89,6 @@ #endif #ifdef HAVE_SIGNAL_H -static guint clean_pid_timeout = 0; /* * Lists of signals we wish to catch and those we wish to ignore. @@ -102,6 +101,7 @@ SIGTERM, SIGQUIT, SIGCHLD, + SIGALRM, -1 }; @@ -175,14 +175,12 @@ * during initialization. But it's not in 0.10.0, so we shouldn't * use it. */ -static gboolean -clean_pid(gpointer data) +static void +clean_pid() { int status; pid_t pid; - clean_pid_timeout = 0; - do { pid = waitpid(-1, &status, WNOHANG); } while (pid != 0 && pid != (pid_t)-1); @@ -194,10 +192,7 @@ } /* Restore signal catching */ - signal(SIGCHLD, sighandler); - - /* This timer should not be called again by glib */ - return FALSE; + signal(SIGALRM, sighandler); } char *segfault_message; @@ -215,10 +210,13 @@ abort(); break; case SIGCHLD: - if (clean_pid_timeout > 0) - gaim_timeout_remove(clean_pid_timeout); - clean_pid_timeout = gaim_timeout_add(1000, clean_pid, NULL); + /* Restore signal catching */ + signal(SIGCHLD, sighandler); + alarm(1); break; + case SIGALRM: + clean_pid(); + break; default: gaim_debug_warning("sighandler", "Caught signal %d\n", sig); gaim_connections_disconnect_all(); @@ -802,8 +800,6 @@ gtk_main(); #ifdef HAVE_SIGNAL_H - if (clean_pid_timeout > 0) - gaim_timeout_remove(clean_pid_timeout); g_free(segfault_message); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |