7275N/ARemove SIGCHLD signal handler.
7275N/A
7275N/ADNS processes are already reaped in libpurple. Sound processes are
7275N/Areaped after 15 seconds. Other processes are sent through GLib and
7275N/Areaped by it. Anyway, this means we can stop preventing GStreamer
7275N/Afrom forking, and maybe fix a D-Bus bug, or something.
7275N/A
7275N/AFixes #5553 - https://developer.pidgin.im/ticket/5553
7275N/AFixes #7902 - https://developer.pidgin.im/ticket/7902
7275N/A
7275N/A(This patch is also included with the Debian version of pidgin.)
7275N/A
7275N/A--- pidgin-2.11.0/pidgin/gtkmain.c.orig 2016-11-08 10:49:01.655270291 +0000
7275N/A+++ pidgin-2.11.0/pidgin/gtkmain.c 2016-11-08 10:52:39.758701309 +0000
7275N/A@@ -88,10 +88,6 @@
7275N/A SIGINT,
7275N/A SIGTERM,
7275N/A SIGQUIT,
7275N/A- SIGCHLD,
7275N/A-#if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING)
7275N/A- SIGALRM,
7275N/A-#endif
7275N/A -1
7275N/A };
7275N/A
7275N/A@@ -134,31 +130,6 @@
7275N/A
7275N/A static int signal_sockets[2];
7275N/A
7275N/A-static void sighandler(int sig);
7275N/A-
7275N/A-/*
7275N/A- * This child process reaping stuff is currently only used for processes that
7275N/A- * were forked to play sounds. It's not needed for forked DNS child, which
7275N/A- * have their own waitpid() call. It might be wise to move this code into
7275N/A- * gtksound.c.
7275N/A- */
7275N/A-static void
7275N/A-clean_pid(void)
7275N/A-{
7275N/A- int status;
7275N/A- pid_t pid;
7275N/A-
7275N/A- do {
7275N/A- pid = waitpid(-1, &status, WNOHANG);
7275N/A- } while (pid != 0 && pid != (pid_t)-1);
7275N/A-
7275N/A- if ((pid == (pid_t) - 1) && (errno != ECHILD)) {
7275N/A- char errmsg[BUFSIZ];
7275N/A- snprintf(errmsg, sizeof(errmsg), "Warning: waitpid() returned %d", pid);
7275N/A- perror(errmsg);
7275N/A- }
7275N/A-}
7275N/A-
7275N/A static void sighandler(int sig)
7275N/A {
7275N/A ssize_t written;
7275N/A@@ -209,33 +180,8 @@
7275N/A return FALSE;
7275N/A }
7275N/A
7275N/A- switch (sig) {
7275N/A-#if defined(USE_GSTREAMER) && !defined(GST_CAN_DISABLE_FORKING)
7275N/A-/* By default, gstreamer forks when you initialize it, and waitpids for the
7275N/A- * child. But if libpurple reaps the child rather than leaving it to
7275N/A- * gstreamer, gstreamer's initialization fails. So, we wait a second before
7275N/A- * reaping child processes, to give gst a chance to reap it if it wants to.
7275N/A- *
7275N/A- * This is not needed in later gstreamers, which let us disable the forking.
7275N/A- * And, it breaks the world on some Real Unices.
7275N/A- */
7275N/A- case SIGCHLD:
7275N/A- /* Restore signal catching */
7275N/A- signal(SIGCHLD, sighandler);
7275N/A- alarm(1);
7275N/A- break;
7275N/A- case SIGALRM:
7275N/A-#else
7275N/A- case SIGCHLD:
7275N/A-#endif
7275N/A- clean_pid();
7275N/A- /* Restore signal catching */
7275N/A- signal(SIGCHLD, sighandler);
7275N/A- break;
7275N/A- default:
7275N/A- purple_debug_warning("sighandler", "Caught signal %d\n", sig);
7275N/A- purple_core_quit();
7275N/A- }
7275N/A+ purple_debug_warning("sighandler", "Caught signal %d\n", sig);
7275N/A+ purple_core_quit();
7275N/A
7275N/A return TRUE;
7275N/A }
7275N/A--- pidgin-2.11.0/pidgin/gtksound.c.orig 2016-11-08 10:49:08.984964482 +0000
7275N/A+++ pidgin-2.11.0/pidgin/gtksound.c 2016-11-08 10:49:36.381141461 +0000
7275N/A@@ -319,9 +319,6 @@
7275N/A
7275N/A #ifdef USE_GSTREAMER
7275N/A purple_debug_info("sound", "Initializing sound output drivers.\n");
7275N/A-#ifdef GST_CAN_DISABLE_FORKING
7275N/A- gst_registry_fork_set_enabled (FALSE);
7275N/A-#endif
7275N/A if ((gst_init_failed = !gst_init_check(NULL, NULL, &error))) {
7275N/A purple_notify_error(NULL, _("GStreamer Failure"),
7275N/A _("GStreamer failed to initialize."),