From 5a85fc9053e9564af0bdd7c37bcc944a8d9fa35f Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 21 Nov 2010 16:46:58 +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 9b4a0e07..0bc50212 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -2463,6 +2463,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); sleep(1); /* slight pause */ initialisation(argc_copy, argv_copy);