about summary refs log tree commit diff homepage
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/server.c b/server.c
index a62b286..ade834d 100644
--- a/server.c
+++ b/server.c
@@ -19,7 +19,6 @@
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <libutil.h>
 #include <signal.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -34,6 +33,10 @@
 #include <time.h>
 #include <unistd.h>
 
+#ifdef __FreeBSD__
+#include <libutil.h>
+#endif
+
 #include "torus.h"
 
 static struct Tile *tiles;
@@ -371,11 +374,13 @@ int main(int argc, char *argv[]) {
 		}
 	}
 
+#ifdef __FreeBSD__
 	struct pidfh *pid = NULL;
 	if (pidPath) {
 		pid = pidfile_open(pidPath, 0600, NULL);
 		if (!pid) err(EX_CANTCREAT, "%s", pidPath);
 	}
+#endif
 
 	tilesMap(dataPath);
 
@@ -390,11 +395,13 @@ int main(int argc, char *argv[]) {
 	error = bind(server, (struct sockaddr *)&addr, SUN_LEN(&addr));
 	if (error) err(EX_CANTCREAT, "%s", sockPath);
 
+#ifdef __FreeBSD__
 	if (pid) {
 		error = daemon(0, 0);
 		if (error) err(EX_OSERR, "daemon");
 		pidfile_write(pid);
 	}
+#endif
 
 	error = listen(server, 0);
 	if (error) err(EX_OSERR, "listen");
le='2020-04-26 15:16:14 -0400'>2020-04-26Generate XHTML content in Atom entriesJune McEnroe 2020-04-25Style index pageJune McEnroe 2020-04-25Render index.htmlJune McEnroe 2020-04-25Wrap <summary> replies count in <data>June McEnroe 2020-04-25Accumulate thread envelopes before concatenationJune McEnroe 2020-04-24Free envelope in concatDataJune McEnroe 2020-04-24Use replyTo address in mailto:June McEnroe 2020-04-23Wrap quoted lines in <q>June McEnroe