aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian2013-10-18 14:47:47 +0000
committerWynn Wolf Arbor2020-05-24 12:33:55 +0200
commit49e2e9cf1e8551591ed92de0b971c8780b6c313c (patch)
tree7301968e811318d36d21bf489cbbc3437ee0a322
parenta3ec2ed05314be74abfec31b3991ffd2736bad92 (diff)
downloadslowcgi-49e2e9cf1e8551591ed92de0b971c8780b6c313c.tar.gz
Logging to syslog works better with openlog(3). OK blambert
-rw-r--r--slowcgi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/slowcgi.c b/slowcgi.c
index 73de8d7..9540897 100644
--- a/slowcgi.c
+++ b/slowcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slowcgi.c,v 1.15 2013/10/18 14:46:47 florian Exp $ */
+/* $OpenBSD: slowcgi.c,v 1.16 2013/10/18 14:47:47 florian Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
* Copyright (c) 2013 Florian Obser <florian@openbsd.org>
@@ -241,6 +241,7 @@ char *fcgi_socket = "/var/www/run/slowcgi.sock";
int
main(int argc, char *argv[])
{
+ extern char *__progname;
struct passwd *pw;
int c;
@@ -268,6 +269,11 @@ main(int argc, char *argv[])
if (!debug && daemon(1, 0) == -1)
err(1, "daemon");
+ if (!debug) {
+ openlog(__progname, LOG_PID|LOG_NDELAY, LOG_DAEMON);
+ logger = &syslogger;
+ }
+
event_init();
slowcgi_listen(fcgi_socket, pw->pw_gid);