diff mbox series

[liburing,5/6] tests: migrate a skip that used a goto to enter cleanup

Message ID 20220706034059.2817423-6-eschwartz93@gmail.com (mailing list archive)
State New
Headers show
Series More wor on updating exit codes to use | expand

Commit Message

Eli Schwartz July 6, 2022, 3:40 a.m. UTC
We cannot use the general cleanup-and-succeed here. Migrate this to use
exitcode reporting via a new "skip" goto.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 test/mkdir.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/test/mkdir.c b/test/mkdir.c
index 6b3497c..0a6d16f 100644
--- a/test/mkdir.c
+++ b/test/mkdir.c
@@ -72,7 +72,7 @@  int main(int argc, char *argv[])
 	if (ret < 0) {
 		if (ret == -EBADF || ret == -EINVAL) {
 			fprintf(stdout, "mkdirat not supported, skipping\n");
-			goto out;
+			goto skip;
 		}
 		fprintf(stderr, "mkdirat: %s\n", strerror(-ret));
 		goto err;
@@ -97,10 +97,13 @@  int main(int argc, char *argv[])
 		goto err1;
 	}
 
-out:
 	unlinkat(AT_FDCWD, fn, AT_REMOVEDIR);
 	io_uring_queue_exit(&ring);
-	return 0;
+	return T_EXIT_PASS;
+skip:
+	unlinkat(AT_FDCWD, fn, AT_REMOVEDIR);
+	io_uring_queue_exit(&ring);
+	return T_EXIT_SKIP;
 err1:
 	unlinkat(AT_FDCWD, fn, AT_REMOVEDIR);
 err: