From b5216499c2077fbd9012b0a8d108e9c9a7776c61 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 21 Nov 2010 16:56:50 +0100 Subject: [PATCH] Don't quit when configfiles are deleted --- src/conky.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/conky.cc b/src/conky.cc index fa62877e..2c0978ee 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -2468,6 +2468,11 @@ void initialisation(int argc, char** argv); /* reload the config file */ static void reload_config(void) { + struct stat sb; + if (stat(current_config.c_str(), &sb) || (!S_ISREG(sb.st_mode) && !S_ISLNK(sb.st_mode))) { + NORM_ERR(_("Config file '%s' is gone, continuing with config from memory.\nIf you recreate this file sent me a SIGUSR1 to tell me about it. ( kill -s USR1 %d )"), current_config.c_str(), getpid()); + return; + } clean_up(NULL, NULL); state.reset(new lua::state); conky::export_symbols(*state);