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

Top Page
Delete this message
Reply to this message
Author: Sheldon Hearn
Date:  
To: Ben Smithurst
CC: Philip Hazel, Exim Users
Subject: Re: [EXIM] exim -q<time> without -bd broken


On Mon, 07 Dec 1998 16:28:00 GMT, Ben Smithurst wrote:

> patching file `daemon.c'
> Hunk #1 FAILED at 1261.
> 1 out of 1 hunk FAILED -- saving rejects to daemon.c.rej


Hi Ben,

I had the same problem, which seems to have been caused by some changes
to indentation that Philip may have forgotten about. Try the attached
patch instead.

BTW, regarding the last changed line in the patch, does a for loop
perform its test condition _before_ moving into the block for the first
time? This is a C question, not an exim question. :-)

Ciao,
Sheldon.

*** src/daemon.c.orig    Tue Dec  8 14:47:14 1998
--- src/daemon.c    Tue Dec  8 15:47:59 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/ ***