summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2013-10-18 14:47:48 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2013-10-18 14:47:48 +0000
commit3a45310bb5a296d079c95f81e13a4a042c627d0b (patch)
tree329e1bb699497215e9018181aae79a2754626341
parentf04d2eef41e25117e947d2e52646967e591f329c (diff)
Logging to syslog works better with openlog(3).
OK blambert
-rw-r--r--usr.sbin/slowcgi/slowcgi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/slowcgi/slowcgi.c b/usr.sbin/slowcgi/slowcgi.c
index 73de8d77a41..9540897fffc 100644
--- a/usr.sbin/slowcgi/slowcgi.c
+++ b/usr.sbin/slowcgi/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);