When mqueue test is skipped because of unmet dependencies and/or
unsupported configuration, it exits with error which is treated as
a fail by the Kselftest framework. This leads to false negative
result even when the test could not be run.
Change it to return kselftest skip code when a test gets skipped to
clearly report that the test could not be run.
Change it to use ksft_exit_skip() when the test is skipped.
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
 #include <mqueue.h>
 #include <error.h>
 
+#include "../kselftest.h"
+
 static char *usage =
 "Usage:\n"
 "  %s path\n"
                }
        }
 
-       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);
-       }
 
        /* Find out what files there are for us to make tweaks in */
        def_msgs = fopen(DEF_MSGS, "r+");
 
 #include <popt.h>
 #include <error.h>
 
+#include "../kselftest.h"
+
 static char *usage =
 "Usage:\n"
 "  %s [-c #[,#..] -f] path\n"
                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+");