diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-16 00:54:50 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-16 00:54:50 +0000 |
commit | a1edc55ebaf7721cbb01aee35a8efe5921029e78 (patch) | |
tree | 5d18bc58a51bc0172a36344cefca255a9030c7fa | |
parent | 769f7cd1db40ef3e620c53a5a30c56851a8d0ecc (diff) |
Merged revisions 131166 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r131166 | tilghman | 2008-07-15 19:52:48 -0500 (Tue, 15 Jul 2008) | 3 lines
Fix rotate strategy
(Closes issue #13086)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@131168 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/logger.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/logger.c b/main/logger.c index aeac79c53..284b12cff 100644 --- a/main/logger.c +++ b/main/logger.c @@ -484,19 +484,19 @@ static int rotate_file(const char *filename) for (which = 0; which < ARRAY_LEN(suffixes); which++) { snprintf(new, sizeof(new), "%s.%d%s", filename, x, suffixes[which]); fd = open(new, O_RDONLY); - if (fd > -1) + if (fd > -1) { close(fd); - else { found = 1; break; } } - if (!found) + if (!found) { break; + } } /* Found an empty slot */ - for (y = x; y > -1; y--) { + for (y = x; y > 0; y--) { for (which = 0; which < ARRAY_LEN(suffixes); which++) { snprintf(old, sizeof(old), "%s.%d%s", filename, y - 1, suffixes[which]); fd = open(old, O_RDONLY); |