]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 212574 via svnmerge from
authorSean Bright <sean@malleable.com>
Mon, 17 Aug 2009 18:21:38 +0000 (18:21 +0000)
committerSean Bright <sean@malleable.com>
Mon, 17 Aug 2009 18:21:38 +0000 (18:21 +0000)
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.1@212579 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/logger.c

index 40f1cda6267faea2b84d86d6a30c4ed9c4a7782d..8a0f110942d2eb8dd735cc0dddf0022f7fcedaba 100644 (file)
@@ -571,7 +571,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);