Mercurial > dropbear
comparison svr-main.c @ 1214:61d3f56808a4
Merge pull request #18 from annulen/dbclient_syslog
Support syslog logging in dbclient.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 15 Dec 2015 21:55:51 +0800 |
parents | 6ecc133fb2ee |
children | 2bb4c662d1c2 |
comparison
equal
deleted
inserted
replaced
1209:ab7d9c12caa7 | 1214:61d3f56808a4 |
---|---|
143 | 143 |
144 /* fork */ | 144 /* fork */ |
145 if (svr_opts.forkbg) { | 145 if (svr_opts.forkbg) { |
146 int closefds = 0; | 146 int closefds = 0; |
147 #ifndef DEBUG_TRACE | 147 #ifndef DEBUG_TRACE |
148 if (!svr_opts.usingsyslog) { | 148 if (!opts.usingsyslog) { |
149 closefds = 1; | 149 closefds = 1; |
150 } | 150 } |
151 #endif | 151 #endif |
152 if (daemon(0, closefds) < 0) { | 152 if (daemon(0, closefds) < 0) { |
153 dropbear_exit("Failed to daemonize: %s", strerror(errno)); | 153 dropbear_exit("Failed to daemonize: %s", strerror(errno)); |
365 /* Things used by inetd and non-inetd modes */ | 365 /* Things used by inetd and non-inetd modes */ |
366 static void commonsetup() { | 366 static void commonsetup() { |
367 | 367 |
368 struct sigaction sa_chld; | 368 struct sigaction sa_chld; |
369 #ifndef DISABLE_SYSLOG | 369 #ifndef DISABLE_SYSLOG |
370 if (svr_opts.usingsyslog) { | 370 if (opts.usingsyslog) { |
371 startsyslog(); | 371 startsyslog(PROGNAME); |
372 } | 372 } |
373 #endif | 373 #endif |
374 | 374 |
375 /* set up cleanup handler */ | 375 /* set up cleanup handler */ |
376 if (signal(SIGINT, sigintterm_handler) == SIG_ERR || | 376 if (signal(SIGINT, sigintterm_handler) == SIG_ERR || |