]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
commandtest: test27: Remove pointless 'cleanup' label
authorPeter Krempa <pkrempa@redhat.com>
Mon, 1 Mar 2021 10:09:02 +0000 (11:09 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 5 Mar 2021 14:33:34 +0000 (15:33 +0100)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/commandtest.c

index 524c959ebadbf418a34218e43254c85155ee51bb..aaf391935c34cc9bb7447bf250c3e123107c38b4 100644 (file)
@@ -1041,7 +1041,6 @@ static int test27(const void *unused G_GNUC_UNUSED)
     g_autoptr(virCommand) cmd = virCommandNew(abs_builddir "/commandhelper");
     int buf1fd;
     int buf2fd;
-    int ret = -1;
     size_t buflen = 1024 * 128;
     g_autofree char *buffer0 = NULL;
     g_autofree char *buffer1 = NULL;
@@ -1093,29 +1092,25 @@ static int test27(const void *unused G_GNUC_UNUSED)
 
     if (virCommandRun(cmd, NULL) < 0) {
         printf("Cannot run child %s\n", virGetLastErrorMessage());
-        goto cleanup;
+        return -1;
     }
 
     if (!outactual || !erractual)
-        goto cleanup;
+        return -1;
 
     if (STRNEQ(outactual, outexpect)) {
         virTestDifference(stderr, outexpect, outactual);
-        goto cleanup;
+        return -1;
     }
     if (STRNEQ(erractual, errexpect)) {
         virTestDifference(stderr, errexpect, erractual);
-        goto cleanup;
+        return -1;
     }
 
     if (checkoutput("test27") < 0)
-        goto cleanup;
-
-    ret = 0;
-
- cleanup:
+        return -1;
 
-    return ret;
+    return 0;
 }