changeset 21060:9838af97586b

A pidgin fans in Great Britain.U.K thinks that nullclient should explicitly ignore SIGCHLD to avoid defunct dns resolution children. Really?
author Will Thompson <will.thompson@collabora.co.uk>
date Fri, 02 Nov 2007 13:31:01 +0000
parents 0f4a5ff5dc84
children 0d6e582f2679
files libpurple/example/nullclient.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/example/nullclient.c	Fri Nov 02 08:14:05 2007 +0000
+++ b/libpurple/example/nullclient.c	Fri Nov 02 13:31:01 2007 +0000
@@ -269,6 +269,13 @@
 	PurpleAccount *account;
 	PurpleSavedStatus *status;
 
+	/* libpurple's built-in DNS resolution forks processes to perform
+	 * blocking lookups without blocking the main process.  It does not
+	 * handle SIGCHLD itself, so if the UI does not you quickly get an army
+	 * of zombie subprocesses marching around.
+	 */
+	signal(SIGCHLD, SIG_IGN);
+
 	init_libpurple();
 
 	printf("libpurple initialized.\n");