changeset 3076:a7e03c5d2205

[gaim-migrate @ 3090] CLeaner PID stuff. Thanks, BMIller :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sun, 17 Mar 2002 22:23:18 +0000
parents c0928d7fdcf9
children 418fa8658696
files src/aim.c src/browser.c src/buddy.c src/gaim.h src/sound.c src/util.c
diffstat 6 files changed, 7 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Sun Mar 17 21:49:56 2002 +0000
+++ b/src/aim.c	Sun Mar 17 22:23:18 2002 +0000
@@ -406,6 +406,9 @@
 #endif
 		abort();
 		break;
+	case SIGCHLD:
+		clean_pid();
+		break;
 	default:
 		debug_printf("caught signal %d\n", sig);
 		gtkspell_stop();
@@ -576,6 +579,7 @@
 	signal(SIGTERM, sighandler);
 	signal(SIGQUIT, sighandler);
 	signal(SIGPIPE, SIG_IGN);
+	signal(SIGCHLD, sighandler);
 #endif
 
 
--- a/src/browser.c	Sun Mar 17 21:49:56 2002 +0000
+++ b/src/browser.c	Sun Mar 17 22:23:18 2002 +0000
@@ -499,8 +499,6 @@
 		if (status != 6)
 			mozilla_remote_free_lock(window);
 
-		gtk_timeout_add(1000, (GtkFunction)clean_pid, NULL);
-
 		netscape_lock = 0;
 
 		g_free(msg);
@@ -612,8 +610,6 @@
 
 			execvp(args[0], args);
 			_exit(0);
-		} else {
-			gtk_timeout_add(1000, (GtkFunction)clean_pid, NULL);
 		}
 	}
 }
--- a/src/buddy.c	Sun Mar 17 21:49:56 2002 +0000
+++ b/src/buddy.c	Sun Mar 17 22:23:18 2002 +0000
@@ -1551,8 +1551,6 @@
 					args[3] = NULL;
 					execvp(args[0], args);
 					_exit(0);
-				} else if (pid > 0) {
-					gtk_timeout_add(100, (GtkFunction)clean_pid, NULL);
 				}
 			}
 			if (b->options & OPT_POUNCE_SOUND) {
--- a/src/gaim.h	Sun Mar 17 21:49:56 2002 +0000
+++ b/src/gaim.h	Sun Mar 17 22:23:18 2002 +0000
@@ -399,7 +399,7 @@
 extern char *normalize(const char *);
 extern char *tobase64(const char *);
 extern void frombase64(const char *, char **, int *);
-extern gint clean_pid(gpointer);
+extern void clean_pid();
 extern char *date();
 extern gint linkify_text(char *);
 extern FILE *open_log_file (char *);
--- a/src/sound.c	Sun Mar 17 21:49:56 2002 +0000
+++ b/src/sound.c	Sun Mar 17 22:23:18 2002 +0000
@@ -463,8 +463,6 @@
 		}
 
 		_exit(0);
-	} else {
-		g_timeout_add(100, clean_pid, NULL);
 	}
 }
 
@@ -533,8 +531,6 @@
 		}
 
 		_exit(0);
-	} else {
-		g_timeout_add(100, clean_pid, NULL);
 	}
 }
 
--- a/src/util.c	Sun Mar 17 21:49:56 2002 +0000
+++ b/src/util.c	Sun Mar 17 22:23:18 2002 +0000
@@ -613,17 +613,13 @@
 }
 
 
-gboolean clean_pid(gpointer dummy)
+void clean_pid(void)
 {
 	int status;
 	pid_t pid;
 
+	printf ("clean_pid\n");
 	pid = waitpid(-1, &status, WNOHANG);
-
-	if (pid == 0)
-		return TRUE;
-
-	return FALSE;
 }
 
 struct aim_user *find_user(const char *name, int protocol)