]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/testing/selftests/mqueue/mq_perf_tests.c
selftests: mqueue: return Kselftest Skip code for skipped tests
[linux.git] / tools / testing / selftests / mqueue / mq_perf_tests.c
index 8188f72de93c2ae35884a0d2a3cebc9c7a3c1bf5..b019e0b8221c7c0bf565d163e141d9e69d37014f 100644 (file)
@@ -39,6 +39,8 @@
 #include <popt.h>
 #include <error.h>
 
+#include "../kselftest.h"
+
 static char *usage =
 "Usage:\n"
 "  %s [-c #[,#..] -f] path\n"
@@ -626,12 +628,10 @@ int main(int argc, char *argv[])
                cpus_to_pin[0] = cpus_online - 1;
        }
 
-       if (getuid() != 0) {
-               fprintf(stderr, "Not running as root, but almost all tests "
+       if (getuid() != 0)
+               ksft_exit_skip("Not running as root, but almost all tests "
                        "require root in order to modify\nsystem settings.  "
                        "Exiting.\n");
-               exit(1);
-       }
 
        max_msgs = fopen(MAX_MSGS, "r+");
        max_msgsize = fopen(MAX_MSGSIZE, "r+");