Re: [EXIM] exim -q<time> without -bd broken

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: Ben Smithurst
CC: Exim Users
Tárgy: Re: [EXIM] exim -q<time> without -bd broken
On Sun, 6 Dec 1998, Ben Smithurst wrote:

> running a queue-running daemon without it being a listening daemon
> causes a core dump (sig 11) here. This patch seems to fix it ...


Below is an improved patch. Thanks for finding this one, Ben.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



*** exim-2.054/src/daemon.c Mon Nov 23 14:26:53 1998
--- daemon.c    Mon Dec  7 10:36:24 1998
***************
*** 1261,1289 ****
      int i;
      DEBUG(2) debug_printf("child %d ended\n", pid);


!     /* Deal with an accepting process. */


!     for (i = 0; i < smtp_accept_max; i++)
        {
!       if (smtp_pid_slots[i] == pid)
          {
!         smtp_pid_slots[i] = 0;
!         if (smtp_host_address_slots[i] != NULL)
            {
!         store_free(smtp_host_address_slots[i]);
!         smtp_host_address_slots[i] = NULL;
            }
-         if (--smtp_accept_count < 0) smtp_accept_count = 0;
-         DEBUG(2) debug_printf("%d SMTP accept process%s now running\n",
-           smtp_accept_count, (smtp_accept_count == 1)? "" : "es");
-         break;
          }
        }


      /* If it wasn't an accepting process, see if it was a queue-runner
      process, if we are keeping track of them. */


!     if (queue_interval > 0 && i >= smtp_accept_max)
        {
        for (i = 0; i < queue_run_max; i++)
          {
--- 1261,1293 ----
      int i;
      DEBUG(2) debug_printf("child %d ended\n", pid);


!     /* If it's a listening daemon, deal with an accepting process. */


!     if (daemon_listen)
        {
!       for (i = 0; i < smtp_accept_max; i++)
          {
!         if (smtp_pid_slots[i] == pid)
            {
!           smtp_pid_slots[i] = 0;
!           if (smtp_host_address_slots[i] != NULL)
!             {
!           store_free(smtp_host_address_slots[i]);
!           smtp_host_address_slots[i] = NULL;
!             }
!           if (--smtp_accept_count < 0) smtp_accept_count = 0;
!           DEBUG(2) debug_printf("%d SMTP accept process%s now running\n",
!             smtp_accept_count, (smtp_accept_count == 1)? "" : "es");
!           break;
            }
          }
+       if (i < smtp_accept_max) continue;  /* Found an accepting process */
        }


      /* If it wasn't an accepting process, see if it was a queue-runner
      process, if we are keeping track of them. */


!     if (queue_interval > 0)
        {
        for (i = 0; i < queue_run_max; i++)
          {




--
*** Exim information can be found at http://www.exim.org/ ***