From: Barrett Schonefeld <bschoney@xxxxxxxxxx> - src/util/virrotatingfile.c Signed-off-by: Barrett Schonefeld <bschoney@xxxxxxxxxx> --- src/util/virrotatingfile.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c index 6d8076e7c4..45dc66e94d 100644 --- a/src/util/virrotatingfile.c +++ b/src/util/virrotatingfile.c @@ -364,7 +364,6 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file) size_t i; g_autofree char *nextpath = NULL; g_autofree char *thispath = NULL; - int ret = -1; VIR_DEBUG("Rollover %s", file->basepath); if (file->maxbackup == 0) { @@ -373,7 +372,7 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file) virReportSystemError(errno, _("Unable to remove %s"), file->basepath); - goto cleanup; + return -1; } } else { nextpath = g_strdup_printf("%s.%zu", file->basepath, file->maxbackup - 1); @@ -391,7 +390,7 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file) virReportSystemError(errno, _("Unable to rename %s to %s"), thispath, nextpath); - goto cleanup; + return -1; } VIR_FREE(nextpath); @@ -401,9 +400,7 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file) VIR_DEBUG("Rollover done %s", file->basepath); - ret = 0; - cleanup: - return ret; + return 0; } -- 2.29.0