Index: [thread] [date] [author] [stats]
  From: markus schnalke <meillo@marmaro.de>
  To  : <masqmail@marmaro.de>
  Date: Thu, 10 Jun 2010 19:49:41 +0200

Removal of unused SIGCHLD handler

Hoi,

I discovered sigchild_handler() in child.c which is not used. There is
however sigchld_handler() (without `i') in listen.c which *is* used,
and the same in get.c.

Can anyone remember the history of this? Is sigchild_handler() the old
way and it just wasn't deleted?

AFAIS sigchild_handler() in child.c is dead code. I would remove it.
Does anyone disagree?

I would like to do:

--- a/src/child.c       Sun May 30 21:01:45 2010 +0200
+++ b/src/child.c       Thu Jun 10 19:38:33 2010 +0200
@@ -27,14 +27,6 @@
 
 #include "masqmail.h"

-int volatile sigchild_seen = 0;
-
-static void
-sigchild_handler(int sig)
-{
-       sigchild_seen = 1;
-       signal(SIGHUP, sigchild_handler);
-}
 
 int
 child(const char *command)
@@ -44,11 +36,6 @@
        if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe) == 0) {
                pid_t pid;

-               /*
-                  sigchild_seen = 0;
-                  signal(SIGCHLD, sigchild_handler);
-                */
-               
                pid = fork();
                if (pid == 0) {
                        int i, max_fd = sysconf(_SC_OPEN_MAX);



meillo


P.S.
It seems there is a bug in this dead code anyway, as the SIGCHLD
handler installes itself again as SIGHUP handler.


Index: [thread] [date] [author] [stats]