[PATCH 27/30] util: remove cleanup labels

Ryan Gahagan rgahagan at cs.utexas.edu
Mon Nov 23 22:09:48 UTC 2020


From: Barrett Schonefeld <bschoney at utexas.edu>

- src/util/virrotatingfile.c

Signed-off-by: Barrett Schonefeld <bschoney at utexas.edu>
---
 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




More information about the libvir-list mailing list