From 7b4d3ab22988d021d5f12b81aec746f7e486fa52 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Thu, 18 Jul 2024 15:15:18 +0200 Subject: update to 4.3.09 --- src/tcpto.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/tcpto.c') diff --git a/src/tcpto.c b/src/tcpto.c index 82b102f..a600e59 100644 --- a/src/tcpto.c +++ b/src/tcpto.c @@ -10,20 +10,25 @@ #include "byte.h" #include "datetime.h" #include "qmail.h" +#include "auto_qmail.h" +#include "auto_queue.h" char tcpto_buf[BUFSIZE_LINE]; static int flagwasthere; static int fdlock; +void die_home() { _exit(61); } +void die_queue() { _exit(62); } + static int getbuf() { int r; int fd; - fdlock = open_write("queue/lock/tcpto"); + fdlock = open_write("lock/tcpto"); if (fdlock == -1) return 0; - fd = open_read("queue/lock/tcpto"); + fd = open_read("lock/tcpto"); if (fd == -1) { close(fdlock); return 0; } if (lock_ex(fdlock) == -1) { close(fdlock); close(fd); return 0; } r = read(fd,tcpto_buf,sizeof(tcpto_buf)); @@ -43,6 +48,8 @@ int tcpto(struct ip_mx *ix) char *record; datetime_sec when; + if (chdir(auto_queue) == -1) die_queue(); + if (chdir("queue") == -1) die_queue(); flagwasthere = 0; n = getbuf(); @@ -66,6 +73,9 @@ int tcpto(struct ip_mx *ix) } record += 32; } + + if (chdir(auto_qmail) == -1) die_home(); + return 0; } -- cgit v1.2.3