summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMaksim Yevmenkin <emax@FreeBSD.org>2009-03-06 01:34:30 +0000
committerMaksim Yevmenkin <emax@FreeBSD.org>2009-03-06 01:34:30 +0000
commit8158a34150250a5a46d7ad414aa52e600b3177cd (patch)
tree7568fbe3437c72b2f67cf4e1266f56a88c3f8450 /usr.bin
parent8390f99f1a12667a0ed00e253a7ec1035d8bc069 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
index 314149e29bc0..4e0d04bdc097 100644
--- a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
+++ b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
@@ -281,22 +281,8 @@ main(int argc, char *argv[])
}
/* Became daemon if required */
- if (background) {
- switch (fork()) {
- case -1:
- err(1, "Could not fork()");
- /* NOT REACHED */
-
- case 0:
- exit(0);
- /* NOT REACHED */
-
- default:
- if (daemon(0, 0) < 0)
- err(1, "Could not daemon()");
- break;
- }
- }
+ if (background && daemon(0, 0) < 0)
+ err(1, "Could not daemon()");
openlog(SPPD_IDENT, LOG_NDELAY|LOG_PERROR|LOG_PID, LOG_DAEMON);
syslog(LOG_INFO, "Starting on %s...", (tty != NULL)? tty : "stdin/stdout");