diff --git a/main/logger.c b/main/logger.c index aa81f83dae..ba031e06f0 100644 --- a/main/logger.c +++ b/main/logger.c @@ -522,7 +522,7 @@ static int rotate_file(const char *filename) char buf[512]; pbx_builtin_setvar_helper(c, "filename", filename); pbx_substitute_variables_helper(c, exec_after_rotate, buf, sizeof(buf)); - if (ast_safe_system(buf) != -1) { + if (ast_safe_system(buf) == -1) { ast_log(LOG_WARNING, "error executing '%s'\n", buf); } ast_channel_free(c);