fetchmail-friends
[Top] [All Lists]

[fetchmail] Re-exec on rcfile change is broken

2002-07-25 06:19:37
When fetchmail is started in daemon mode with no arguments given, the
re-exec feature of fetchmail won't work. If fetchmail receives the SIGUSR1
signal and the rcfile has changed, fetchmail will send another SIGUSR1
signal to itself and then terminate. This only happens when no arguments
are given to the daemon process. The attached patch fixes the problem.

Moritz Jodeit

--- fetchmail-5.9.13-orig/fetchmail.c   Sat Jun 22 22:03:11 2002
+++ fetchmail-5.9.13/fetchmail.c        Thu Jul 25 15:00:17 2002
@@ -401,17 +401,14 @@
                 pid);
                return(PS_EXCLUDE);
        }
+       else if (getpid() == pid)
+           /* this test enables re-execing on a changed rcfile */
+           lock_assert();
        else if (argc > 1)
        {
-           /* this test enables re-execing on a changed rcfile */
-           if (getpid() == pid)
-               lock_assert();
-           else
-           {
-               fprintf(stderr,
-                       GT_("fetchmail: can't accept options while a background 
fetchmail is running.\n"));
-               return(PS_EXCLUDE);
-           }
+           fprintf(stderr,
+                   GT_("fetchmail: can't accept options while a background 
fetchmail is running.\n"));
+           return(PS_EXCLUDE);
        }
        else if (kill(pid, SIGUSR1) == 0)
        {

<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail] Re-exec on rcfile change is broken, Moritz Jodeit <=