Debug: _exit() process-termination
[exim.git] / src / src / queue.c
index 8c9f5cb2ac37e49c0dfba3c0973802b1aa08e93c..0d5b98ff39a5adb4c6e2bc634ffdb241f2d3e844 100644 (file)
@@ -483,10 +483,11 @@ for (int i = queue_run_in_order ? -1 : 0;
       int i;
       if (qpid[f.running_in_test_harness ? 0 : nelem(qpid) - 1])
        {
-       DEBUG(D_queue_run) debug_printf("q2stage waiting for child\n");
+       DEBUG(D_queue_run) debug_printf("q2stage waiting for child %d\n", (int)qpid[0]);
        waitpid(qpid[0], NULL, 0);
        DEBUG(D_queue_run) debug_printf("q2stage reaped child %d\n", (int)qpid[0]);
-       for (i = 0; i < nelem(qpid) - 1; i++) qpid[i] = qpid[i+1];
+       if (f.running_in_test_harness) i = 0;
+       else for (i = 0; i < nelem(qpid) - 1; i++) qpid[i] = qpid[i+1];
        qpid[i] = 0;
        }
       else
@@ -651,7 +652,7 @@ for (int i = queue_run_in_order ? -1 : 0;
       testharness_pause_ms(100);
       (void)close(pfd[pipe_read]);
       rc = deliver_message(fq->text, force_delivery, FALSE);
-      exim_underbar_exit(rc == DELIVER_NOT_ATTEMPTED);
+      exim_underbar_exit(rc == DELIVER_NOT_ATTEMPTED, US"qrun-delivery");
       }
     if (pid < 0)
       log_write(0, LOG_MAIN|LOG_PANIC_DIE, "fork of delivery process from "
@@ -1535,12 +1536,12 @@ if ((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) >= 0)
 #ifdef EXIM_HAVE_ABSTRACT_UNIX_SOCKETS
   int len = offsetof(struct sockaddr_un, sun_path) + 1
     + snprintf(sa_un.sun_path+1, sizeof(sa_un.sun_path)-1, "%s",
-       NOTIFIER_SOCKET_NAME);
+               expand_string(notifier_socket));
   sa_un.sun_path[0] = 0;
 #else
   int len = offsetof(struct sockaddr_un, sun_path)
-    + snprintf(sa_un.sun_path, sizeof(sa_un.sun_path), "%s/%s",
-       spool_directory, NOTIFIER_SOCKET_NAME);
+    + snprintf(sa_un.sun_path, sizeof(sa_un.sun_path), "%s",
+               expand_string(notifier_socket));
 #endif
 
   if (sendto(fd, buf, sizeof(buf), 0, (struct sockaddr *)&sa_un, len) < 0)