summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2018-09-14 21:47:34 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-10-21 20:02:57 +0200
commit3d93ffa7ca7918034ec485fcd7c30b5e6cfe217d (patch)
treed9d8418bfb74f453fab5fd8a2d8e0980a1e6bc50
parent2112b1ca2e821e08bbfe6c197856860b6d49b69f (diff)
downloadcalcurse-3d93ffa7ca7918034ec485fcd7c30b5e6cfe217d.tar.gz
calcurse-3d93ffa7ca7918034ec485fcd7c30b5e6cfe217d.zip
Periodic save: report cancelled save
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index 9f20a18..d3c9c0b 100644
--- a/src/io.c
+++ b/src/io.c
@@ -1421,12 +1421,14 @@ static void *io_psave_thread(void *arg)
{
int delay = conf.periodic_save;
EXIT_IF(delay < 0, _("Invalid delay"));
+ char *mesg = _("Periodic save: data files have changed. Save cancelled.");
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
for (;;) {
sleep(delay * MININSEC);
pthread_mutex_lock(&io_periodic_save_mutex);
- io_save_cal(periodic);
+ if (io_save_cal(periodic) == IO_SAVE_CANCEL)
+ que_ins(mesg, now(), 2);
pthread_mutex_unlock(&io_periodic_save_mutex);
}
}