Summary: | ASTERISK-14607: LOGGER WARNING : error executing after rotate | ||
Reporter: | loic (loic) | Labels: | |
Date Opened: | 2009-08-06 08:36:28 | Date Closed: | 2009-08-17 13:22:11 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | When the parameter "exec_after_rotate" is enabled on logger.conf (for example to execute gzip -9 ${filename}.2 for compresing logs) and I execute 'asterisk -rx "logger rotate" I have this WARNING : WARNING[23788]: logger.c:581 rotate_file: error executing 'gzip -9 /var/log/asterisk/messages.2' for each log I want to rotate. However rotate action and gzip compression are well executed. To avoid that, I saw in logger.c and I found a mistake I think ;) : if (ast_safe_system(buf) != -1) { ast_log(LOG_WARNING, "error executing '%s'\n", buf); } It's not good because asterisk.c return -1 exclusively for problems when executing 'the exec_after_rotate' command. So, I replaced '!=' by '==' because for me it's the right symbol. What do you think about that... | ||
Comments: | By: Digium Subversion (svnbot) 2009-08-17 13:18:45 Repository: asterisk Revision: 212574 U trunk/main/logger.c ------------------------------------------------------------------------ r212574 | seanbright | 2009-08-17 13:18:45 -0500 (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 ASTERISK-14607) Reported by: loic ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=212574 By: Digium Subversion (svnbot) 2009-08-17 13:22:05 Repository: asterisk Revision: 212578 U branches/1.6.0/main/logger.c ------------------------------------------------------------------------ r212578 | seanbright | 2009-08-17 13:22:04 -0500 (Mon, 17 Aug 2009) | 15 lines 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 ASTERISK-14607) Reported by: loic ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=212578 By: Digium Subversion (svnbot) 2009-08-17 13:22:08 Repository: asterisk Revision: 212579 U branches/1.6.1/main/logger.c ------------------------------------------------------------------------ r212579 | seanbright | 2009-08-17 13:22:08 -0500 (Mon, 17 Aug 2009) | 15 lines 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 ASTERISK-14607) Reported by: loic ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=212579 By: Digium Subversion (svnbot) 2009-08-17 13:22:11 Repository: asterisk Revision: 212580 U branches/1.6.2/main/logger.c ------------------------------------------------------------------------ r212580 | seanbright | 2009-08-17 13:22:11 -0500 (Mon, 17 Aug 2009) | 15 lines 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 ASTERISK-14607) Reported by: loic ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=212580 |