blob: 03c6c659e7bf6960e6fd94939a373a52912ece3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
$NetBSD: patch-ab,v 1.1.1.1 2001/08/21 12:00:14 rh Exp $
--- pen.c.orig Mon Aug 20 21:02:54 2001
+++ pen.c
@@ -33,6 +33,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/param.h>
#include <fcntl.h>
#include <unistd.h>
#include <syslog.h>
@@ -465,6 +466,7 @@
exit(0);
}
+#if !(defined(BSD) && BSD >= 199306)
static void background(void)
{
int childpid;
@@ -478,6 +480,7 @@
setpgrp();
signal(SIGCHLD, SIG_IGN);
}
+#endif
static void init(int argc, char **argv)
{
@@ -817,7 +820,11 @@
signal(SIGCHLD, SIG_IGN);
if (!foreground) {
+#if (defined(BSD) && BSD >= 199306)
+ daemon(0, 0);
+#else
background();
+#endif
}
listenfd = open_listener(argv[0]);
|