diff options
author | emax <emax@FreeBSD.org> | 2009-02-04 22:04:06 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2009-02-04 22:04:06 +0000 |
commit | ebea9bff1dbd39061821016995df2ed6229638fe (patch) | |
tree | fe79fa257b8da5af41a6be92e335edf2f75cbfab /usr.sbin/bluetooth/hcsecd | |
parent | f0da128350a84dfa9167374bf7dcbc4f03500c6a (diff) | |
download | FreeBSD-src-ebea9bff1dbd39061821016995df2ed6229638fe.zip FreeBSD-src-ebea9bff1dbd39061821016995df2ed6229638fe.tar.gz |
Clenup code a bit and do not call fork(2) before dameon(3) where not needed.
MFC after: 1 month
Diffstat (limited to 'usr.sbin/bluetooth/hcsecd')
-rw-r--r-- | usr.sbin/bluetooth/hcsecd/hcsecd.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); |