changeset 3806:b7a6aa99ee7c

[gaim-migrate @ 3949] Damned sound. Thanks, Rob McQueen. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 26 Oct 2002 19:16:26 +0000
parents 3c0bbaec90ed
children e403c93110d0
files src/aim.c src/gaim.h src/util.c
diffstat 3 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Sat Oct 26 18:12:17 2002 +0000
+++ b/src/aim.c	Sat Oct 26 19:16:26 2002 +0000
@@ -395,6 +395,12 @@
 #endif
 		abort();
 		break;
+	case SIGCHLD:
+		clean_pid();
+#if HAVE_SIGNAL_H
+		signal(SIGCHLD, sighandler);    /* restore signal catching on this one! */
+#endif
+		break;
 	default:
 		debug_printf("caught signal %d\n", sig);
 		signoff_all(NULL, NULL);
--- a/src/gaim.h	Sat Oct 26 18:12:17 2002 +0000
+++ b/src/gaim.h	Sat Oct 26 19:16:26 2002 +0000
@@ -445,6 +445,7 @@
 extern char *normalize(const char *);
 extern char *tobase64(const char *);
 extern void frombase64(const char *, char **, int *);
+extern void clean_pid();
 extern char *date();
 extern gint linkify_text(char *);
 extern FILE *open_log_file (char *, int);
--- a/src/util.c	Sat Oct 26 18:12:17 2002 +0000
+++ b/src/util.c	Sat Oct 26 19:16:26 2002 +0000
@@ -642,6 +642,21 @@
 	return date;
 }
 
+void clean_pid(void)
+{
+#ifndef _WIN32
+	int status;
+	pid_t pid;
+
+	pid = waitpid(-1, &status, 0);
+	if(pid < 0 && errno != ECHILD) {
+		char errmsg[BUFSIZ];
+		sprintf(errmsg, "Warning: waitpid() returned %d", pid);
+		perror(errmsg);
+	}
+#endif
+}
+
 struct aim_user *find_user(const char *name, int protocol)
 {
 	char *who = g_strdup(normalize(name));