Tolerant logger creation failure

Fix resetting a background compton

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-02-09 02:49:09 +00:00
parent 39faac0f83
commit fc2353d186
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 4 additions and 4 deletions

View File

@ -2613,11 +2613,11 @@ session_init(int argc, char **argv, Display *dpy, const char *config_file,
log_init_tls(); log_init_tls();
auto stderr_logger = stderr_logger_new(); auto stderr_logger = stderr_logger_new();
if (!stderr_logger) { if (stderr_logger) {
fprintf(stderr, "Cannot create any logger, giving up.\n"); // stderr logger might fail to create if we are already
abort(); // daemonized.
}
log_add_target_tls(stderr_logger); log_add_target_tls(stderr_logger);
}
// Allocate a session and copy default values into it // Allocate a session and copy default values into it
session_t *ps = cmalloc(session_t); session_t *ps = cmalloc(session_t);