summaryrefslogtreecommitdiff
path: root/user/netqmail/0004-notifyfd.patch
diff options
context:
space:
mode:
authorLaurent Bercot <ska-adelie@skarnet.org>2018-08-28 16:14:58 +0000
committerLaurent Bercot <ska-adelie@skarnet.org>2018-08-28 16:14:58 +0000
commit6990bd384a5a11f1dfa75bc32d094dd02d1851a2 (patch)
tree8a0febc1bd96aafde6f622faf5ca43abbcce51f1 /user/netqmail/0004-notifyfd.patch
parent3f2f1bfb288e936b66a25b31319690fb479fa10c (diff)
downloadpackages-6990bd384a5a11f1dfa75bc32d094dd02d1851a2.tar.gz
packages-6990bd384a5a11f1dfa75bc32d094dd02d1851a2.tar.bz2
packages-6990bd384a5a11f1dfa75bc32d094dd02d1851a2.tar.xz
packages-6990bd384a5a11f1dfa75bc32d094dd02d1851a2.zip
user/netqmail: new package. First of *many* iterations.
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())
+ {