Do not start the daemon more than once

Avoid starting multiple daemon instances if the --daemon argument is
passed and the daemon is already running. Terminate the already running
instance before spawning a new one instead.

Suggested-by: Vlad Glagolev <scm@vaygr.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-10-19 18:17:08 +02:00
parent 095576b945
commit 0d74c14fd1
3 changed files with 4 additions and 3 deletions

View File

@@ -803,6 +803,7 @@ int parse_args(int argc, char **argv)
io_export_data(xfmt, export_uid);
} else if (daemon) {
notify_init_vars();
dmon_stop();
dmon_start(0);
} else {
/* interactive mode */