pkgsrc/security/smtpd/patches/patch-ab
2002-11-30 14:56:53 +00:00

39 lines
792 B
Text

$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;
}