diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-11-18 22:27:09 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2019-01-07 16:57:53 +0100 |
commit | ad183c61a93ca0146407d314d4ae671c894f88a8 (patch) | |
tree | ef82f839041d99eb099fa3a761308cbca1e89a27 | |
parent | 7851f46fbb1e84fe4fa62a36d1f79b936f040e66 (diff) | |
download | calcurse-ad183c61a93ca0146407d314d4ae671c894f88a8.tar.gz calcurse-ad183c61a93ca0146407d314d4ae671c894f88a8.zip |
CLI: do not start daemon if calcurse is running
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r-- | src/args.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -390,7 +390,7 @@ int parse_args(int argc, char **argv) const char *cfile = NULL, *ifile = NULL, *confdir = NULL; int non_interactive = 1; - int ch; + int ch, cpid; regex_t reg; char buf[BUFSIZ]; struct tm tm; @@ -743,6 +743,8 @@ int parse_args(int argc, char **argv) status = 1; break; case OPT_DAEMON: + EXIT_IF(cpid = io_get_pid(path_cpid), + _("calcurse is running (pid = %d)"), cpid); daemon = 1; filter.type_mask = TYPE_MASK_APPT | TYPE_MASK_RECUR_APPT; break; |