mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
Correct the return value check for ast_safe_system.
The logic here was reversed as ast_safe_system returns -1 on error and not on success. Fix suggested by reporter. (closes issue #15667) Reported by: loic git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -539,7 +539,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);
|
||||
}
|
||||
c = ast_channel_release(c);
|
||||
|
Reference in New Issue
Block a user