fix compiler warning
This commit is contained in:
parent
69dd3f5611
commit
b592ac3cb7
|
@ -330,7 +330,10 @@ bool ladish_rotate(const char * src, const char * dst, unsigned int max_backups)
|
||||||
bool oldest_found;
|
bool oldest_found;
|
||||||
unsigned int backup;
|
unsigned int backup;
|
||||||
|
|
||||||
|
ASSERT(max_backups > 0);
|
||||||
|
|
||||||
oldest_found = false;
|
oldest_found = false;
|
||||||
|
path = NULL;
|
||||||
older_path = NULL;
|
older_path = NULL;
|
||||||
backup = max_backups;
|
backup = max_backups;
|
||||||
while (backup > 0)
|
while (backup > 0)
|
||||||
|
@ -383,6 +386,8 @@ bool ladish_rotate(const char * src, const char * dst, unsigned int max_backups)
|
||||||
backup--;
|
backup--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT(path != NULL);
|
||||||
|
|
||||||
log_info("rename '%s' -> '%s'", dst, path);
|
log_info("rename '%s' -> '%s'", dst, path);
|
||||||
if (rename(dst, path) != 0 && errno != ENOENT)
|
if (rename(dst, path) != 0 && errno != ENOENT)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue