From: Sean Bright Date: Mon, 17 Aug 2009 18:21:36 +0000 (+0000) Subject: Merged revisions 212574 via svnmerge from X-Git-Tag: 1.6.0.16~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e15112b47c958e086214b1fb6e25f1088eb60908;p=thirdparty%2Fasterisk.git Merged revisions 212574 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r212574 | seanbright | 2009-08-17 14:18:16 -0400 (Mon, 17 Aug 2009) | 8 lines 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/branches/1.6.0@212578 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- 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);