Start and log daemon activity only if requested.
This commit is contained in:
parent
989b6c885f
commit
55d6703fad
@ -11,6 +11,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 <frederic@culot.org>
|
||||
|
||||
* src/custom.c (custom_load_conf): use a larger buffer to read
|
||||
|
@ -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,6 +56,7 @@
|
||||
#define DMON_SLEEP_TIME 60
|
||||
|
||||
#define DMON_LOG(...) do { \
|
||||
if (dmon.log) \
|
||||
(void)io_fprintln (path_dmon_log, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
@ -182,6 +183,7 @@ dmon_start (int parent_exit_status)
|
||||
io_load_app ();
|
||||
data_loaded = 1;
|
||||
|
||||
DMON_LOG (_("started at %s\n"), nowstr ());
|
||||
for (;;)
|
||||
{
|
||||
int left;
|
||||
|
@ -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,6 +88,7 @@ exit_calcurse (int status)
|
||||
if (unlink (path_cpid) != 0)
|
||||
EXIT (_("Could not remove calcurse lock file: %s\n"),
|
||||
strerror (errno));
|
||||
if (dmon.enable)
|
||||
dmon_start (status);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user