From ebea9bff1dbd39061821016995df2ed6229638fe Mon Sep 17 00:00:00 2001 From: emax Date: Wed, 4 Feb 2009 22:04:06 +0000 Subject: Clenup code a bit and do not call fork(2) before dameon(3) where not needed. MFC after: 1 month --- usr.sbin/bluetooth/hcsecd/hcsecd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.sbin/bluetooth/hcsecd') diff --git a/usr.sbin/bluetooth/hcsecd/hcsecd.c b/usr.sbin/bluetooth/hcsecd/hcsecd.c index de7a775..72f9c8c 100644 --- a/usr.sbin/bluetooth/hcsecd/hcsecd.c +++ b/usr.sbin/bluetooth/hcsecd/hcsecd.c @@ -128,9 +128,8 @@ main(int argc, char *argv[]) (void * const) &filter, sizeof(filter)) < 0) err(1, "Could not set HCI socket filter"); - if (detach) - if (daemon(0, 0) < 0) - err(1, "Could not daemon()ize"); + if (detach && daemon(0, 0) < 0) + err(1, "Could not daemon()ize"); openlog(HCSECD_IDENT, LOG_NDELAY|LOG_PERROR|LOG_PID, LOG_DAEMON); -- cgit v1.1