fix compiler warning

This commit is contained in:
Nedko Arnaudov 2011-10-11 01:24:53 +03:00
parent 69dd3f5611
commit b592ac3cb7
1 changed files with 5 additions and 0 deletions

View File

@ -330,7 +330,10 @@ bool ladish_rotate(const char * src, const char * dst, unsigned int max_backups)
bool oldest_found;
unsigned int backup;
ASSERT(max_backups > 0);
oldest_found = false;
path = NULL;
older_path = NULL;
backup = max_backups;
while (backup > 0)
@ -383,6 +386,8 @@ bool ladish_rotate(const char * src, const char * dst, unsigned int max_backups)
backup--;
}
ASSERT(path != NULL);
log_info("rename '%s' -> '%s'", dst, path);
if (rename(dst, path) != 0 && errno != ENOENT)
{