From 55d6703fad50e800a6adcc064abe060eab7d27d1 Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Sat, 1 Aug 2009 17:53:11 +0000 Subject: Start and log daemon activity only if requested. --- ChangeLog | 4 ++++ src/dmon.c | 8 +++++--- src/utils.c | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81deeba..a4fd6b3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,10 @@ * src/custom (custom_load_conf): restore daemon configuration options + + * src/utils.c (exit_calcurse): start daemon only if requested + + * src/dmon.c (DMON_LOG): log daemon activity only if requested 2009-07-29 Frederic Culot diff --git a/src/dmon.c b/src/dmon.c index bae65d6..2f28d4c 100644 --- a/src/dmon.c +++ b/src/dmon.c @@ -1,4 +1,4 @@ -/* $calcurse: dmon.c,v 1.9 2009/08/01 13:31:20 culot Exp $ */ +/* $calcurse: dmon.c,v 1.10 2009/08/01 17:53:11 culot Exp $ */ /* * Calcurse - text-based organizer @@ -56,7 +56,8 @@ #define DMON_SLEEP_TIME 60 #define DMON_LOG(...) do { \ - (void)io_fprintln (path_dmon_log, __VA_ARGS__); \ + if (dmon.log) \ + (void)io_fprintln (path_dmon_log, __VA_ARGS__); \ } while (0) #define DMON_ABRT(...) do { \ @@ -181,7 +182,8 @@ dmon_start (int parent_exit_status) recur_apoint_llist_init (); io_load_app (); data_loaded = 1; - + + DMON_LOG (_("started at %s\n"), nowstr ()); for (;;) { int left; diff --git a/src/utils.c b/src/utils.c index 37eab66..2354ad1 100755 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,4 @@ -/* $calcurse: utils.c,v 1.81 2009/07/27 19:35:09 culot Exp $ */ +/* $calcurse: utils.c,v 1.82 2009/08/01 17:53:11 culot Exp $ */ /* * Calcurse - text-based organizer @@ -88,7 +88,8 @@ exit_calcurse (int status) if (unlink (path_cpid) != 0) EXIT (_("Could not remove calcurse lock file: %s\n"), strerror (errno)); - dmon_start (status); + if (dmon.enable) + dmon_start (status); } exit (status); -- cgit v1.2.3-70-g09d2