summaryrefslogtreecommitdiff
path: root/src/qmail-rspawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmail-rspawn.c')
-rw-r--r--src/qmail-rspawn.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qmail-rspawn.c b/src/qmail-rspawn.c
index a9b0a1a..b0e5bf0 100644
--- a/src/qmail-rspawn.c
+++ b/src/qmail-rspawn.c
@@ -8,6 +8,7 @@
#include "ipalloc.h"
#include "tcpto.h"
#include "auto_qmail.h"
+#include "auto_queue.h"
#include "open.h"
#include "pathexec.h"
@@ -27,7 +28,7 @@ void report(buffer *log,int wstat,char *s,int len)
switch (wait_exitcode(wstat)) {
case 0: break;
case 111: buffer_putsflush(log,"Zqmail-rspawn: Unable to run qmail-remote.\n"); break;
- default: buffer_putsflush(log,"Dqmail-rspawn: Unable to run qmail-remote. \n"); return;
+ default: buffer_putsflush(log,"Dqmail-rspawn: Unable to run qmail-remote.\n"); return;
}
if (!len) { buffer_putsflush(log,"Zqmail-rspawn: qmail-remote produced no output.\n"); return; }
@@ -75,8 +76,8 @@ int spawn(int fdmess,int fdout,const char *s,char *r,const int at)
char *(args[5]);
struct stat st;
- if (chdir(auto_qmail) == -1) _exit(110);
- if (stat("control/dkimdomains",&st) !=1)
+ if (chdir(auto_qmail) == -1) _exit(61);
+ if (!stat("control/dkimdomains",&st))
args[0] = "qmail-dksign";
else
args[0] = "qmail-remote";
@@ -85,12 +86,13 @@ int spawn(int fdmess,int fdout,const char *s,char *r,const int at)
args[3] = r;
args[4] = 0;
- if (chdir("queue/mess") == -1) _exit(110);
+ if (chdir(auto_queue) == -1) _exit(62);
+ if (chdir("queue/mess") == -1) _exit(62);
if (!(f = vfork())) {
- if (fd_move(0,fdmess) == -1) _exit(111);
- if (fd_move(1,fdout) == -1) _exit(111);
- if (fd_copy(2,1) == -1) _exit(111);
+ if (fd_move(0,fdmess) == -1) _exit(63);
+ if (fd_move(1,fdout) == -1) _exit(63);
+ if (fd_copy(2,1) == -1) _exit(63);
pathexec(args);
if (errno) _exit(111);
_exit(100);