aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bluetooth/rfcomm_sppd
diff options
context:
space:
mode:
authorMaksim Yevmenkin <emax@FreeBSD.org>2009-02-04 22:04:06 +0000
committerMaksim Yevmenkin <emax@FreeBSD.org>2009-02-04 22:04:06 +0000
commitd37245a0dea6ab123648a45c52b7abae7bf1302c (patch)
treefe79fa257b8da5af41a6be92e335edf2f75cbfab /usr.bin/bluetooth/rfcomm_sppd
parenta620f9a577d70bfa16890bb286fc2999612a6e03 (diff)
Notes
Diffstat (limited to 'usr.bin/bluetooth/rfcomm_sppd')
-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");