summaryrefslogtreecommitdiff
path: root/user/netqmail/0004-notifyfd.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/netqmail/0004-notifyfd.patch')
-rw-r--r--user/netqmail/0004-notifyfd.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/user/netqmail/0004-notifyfd.patch b/user/netqmail/0004-notifyfd.patch
new file mode 100644
index 000000000..d734b1417
--- /dev/null
+++ b/user/netqmail/0004-notifyfd.patch
@@ -0,0 +1,41 @@
+--- netqmail-1.06.old/qmail-send.c
++++ netqmail-1.06/qmail-send.c
+@@ -1,5 +1,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <fcntl.h>
++#include <stdlib.h>
+ #include "readwrite.h"
+ #include "sig.h"
+ #include "direntry.h"
+@@ -1521,7 +1523,17 @@
+ int nfds;
+ struct timeval tv;
+ int c;
++ int notifyfd = -1;
+
++ {
++ char *x = getenv("QMAIL_NOTIFY_FD") ;
++ if (x)
++ {
++ unsigned long u;
++ if (scan_ulong(x, &u) && fcntl(u, F_GETFD) >= 0) notifyfd = (int)u;
++ }
++ }
++
+ if (chdir(auto_qmail) == -1)
+ { log1("alert: cannot start: unable to switch to home directory\n"); _exit(111); }
+ if (!getcontrols())
+@@ -1567,6 +1579,12 @@
+ pass_init();
+ todo_init();
+ cleanup_init();
++
++ if (notifyfd >=0)
++ {
++ write(notifyfd, "\n", 1);
++ close(notifyfd);
++ }
+
+ while (!flagexitasap || !del_canexit())
+ {