diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-01-19 22:14:59 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-01-19 22:14:59 +0000 |
commit | 358fd1c1f4a820f45068b750cf001de23342f38b (patch) | |
tree | 1e17230bd7fcd3c86cd60948f3ed6b95fd3489a3 | |
parent | e36b830e0b772a0ccba8275e634b624217b37577 (diff) |
No need to become a daemon
-rw-r--r-- | audio/headset.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/audio/headset.c b/audio/headset.c index 8499781b..28d369c6 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -1574,14 +1574,10 @@ static DBusHandlerResult hs_stop(DBusConnection *conn, DBusMessage *msg) int main(int argc, char *argv[]) { struct sigaction sa; - int opt, daemonize = 1; + int opt; - while ((opt = getopt(argc, argv, "nc:o:i:")) != EOF) { + while ((opt = getopt(argc, argv, "c:o:i:")) != EOF) { switch (opt) { - case 'n': - daemonize = 0; - break; - case 'c': config_channel = strtol(optarg, NULL, 0); break; @@ -1605,17 +1601,10 @@ int main(int argc, char *argv[]) exit(1); } - if (argv[optind]) { + if (argv[optind]) on_init_bda = argv[optind]; - daemonize = 0; - } - - if (daemonize && daemon(0, 0)) { - error("Can't daemonize: %s (%d)", strerror(errno), errno); - exit(1); - } - start_logging("bt.headsetd", "Bluetooth Headset daemon"); + start_logging("headset", "Bluetooth Headset daemon"); memset(&sa, 0, sizeof(sa)); sa.sa_flags = SA_NOCLDSTOP; |