summaryrefslogtreecommitdiff
path: root/security/smtpd/patches
diff options
context:
space:
mode:
authormjl <mjl@pkgsrc.org>2002-11-30 14:56:53 +0000
committermjl <mjl@pkgsrc.org>2002-11-30 14:56:53 +0000
commitd06d8cf7ea5e9a76f67274531e84c9e4e5f91c87 (patch)
treeba65eddaff80be9cf5bb87661f69901c1bdc8b82 /security/smtpd/patches
parent4b4686acf867bdb4d21a753e30c929f755141e3c (diff)
downloadpkgsrc-d06d8cf7ea5e9a76f67274531e84c9e4e5f91c87.tar.gz
Add patch to reopen stdout/stderr to /dev/null to quelch whining about
closed descriptors in syslog.
Diffstat (limited to 'security/smtpd/patches')
-rw-r--r--security/smtpd/patches/patch-ab39
1 files changed, 39 insertions, 0 deletions
diff --git a/security/smtpd/patches/patch-ab b/security/smtpd/patches/patch-ab
new file mode 100644
index 00000000000..cd267911d1b
--- /dev/null
+++ b/security/smtpd/patches/patch-ab
@@ -0,0 +1,39 @@
+$NetBSD: patch-ab,v 1.1 2002/11/30 14:56:53 mjl Exp $
+
+--- smtpfwdd.c.orig Sat Nov 30 15:41:10 2002
++++ smtpfwdd.c Sat Nov 30 15:49:33 2002
+@@ -636,6 +636,18 @@
+ exit(EX_OSERR);
+ }
+
++ /* Reopen stderr and stdout to /dev/null to quelch whining */
++
++ if(open("/dev/null", O_WRONLY | O_APPEND) != 1) {
++ syslog(LOG_ERR, "Couldn't open /dev/null as stdout (%m)");
++ exit(EX_OSERR);
++ }
++
++ if(dup(1) != 2) {
++ syslog(LOG_ERR, "Couldn't dup /dev/null as stderr (%m)");
++ exit(EX_OSERR);
++ }
++
+ fclose(f);
+ closelog();
+ if (lseek(0, body, SEEK_SET) < 0) {
+@@ -760,7 +772,7 @@
+ * The brains of this operation
+ */
+
+-void
++int
+ main(int argc, char **argv)
+ {
+ int opt;
+@@ -1129,4 +1141,6 @@
+ sleep(poll_time);
+ }
+ }
++
++return 0;
+ }