mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
Use FAIL_UNSUPPORTED more
In a few places, we weren't exiting w/ 77 when skipping. Fix that by using our standard macro for it. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@@ -30,7 +30,7 @@ do_test (void)
|
||||
/* Permissions on /dev/null (the opened descriptor) cannot be changed. */
|
||||
int fd = xopen ("/dev/null", O_RDWR, 0);
|
||||
if (getuid () == 0)
|
||||
puts ("info: /dev/null fchmod test skipped because of root privileges");
|
||||
FAIL_UNSUPPORTED ("/dev/null fchmod test skipped because of root privileges");
|
||||
else
|
||||
{
|
||||
errno = 0;
|
||||
|
||||
+3
-4
@@ -23,6 +23,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <support/check.h>
|
||||
|
||||
static pthread_barrier_t b3, b4;
|
||||
static uid_t prev_ruid, prev_euid, prev_suid, nobody_uid;
|
||||
@@ -1049,15 +1050,13 @@ do_test (void)
|
||||
if (prev_ruid == nobody_uid || prev_euid == nobody_uid
|
||||
|| prev_suid == nobody_uid)
|
||||
{
|
||||
puts ("already running as user nobody, skipping tests");
|
||||
exit (0);
|
||||
FAIL_UNSUPPORTED ("already running as user nobody");
|
||||
}
|
||||
|
||||
if (prev_rgid == nobody_gid || prev_egid == nobody_gid
|
||||
|| prev_sgid == nobody_gid)
|
||||
{
|
||||
puts ("already running as group nobody, skipping tests");
|
||||
exit (0);
|
||||
FAIL_UNSUPPORTED ("already running as group nobody");
|
||||
}
|
||||
|
||||
if (pthread_barrier_init (&b3, NULL, 3) != 0)
|
||||
|
||||
+2
-2
@@ -37,6 +37,7 @@ do_test ()
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <support/check.h>
|
||||
#include <support/xunistd.h>
|
||||
|
||||
static pthread_barrier_t barrier;
|
||||
@@ -156,8 +157,7 @@ do_test (void)
|
||||
if (timer_create (my_thread_clock, NULL, &t) != 0)
|
||||
{
|
||||
printf ("timer_create: %m\n");
|
||||
puts ("No support for CPU clocks with good semantics, skipping test");
|
||||
return 0;
|
||||
FAIL_UNSUPPORTED ("No support for CPU clocks with good semantics");
|
||||
}
|
||||
timer_delete (t);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <support/check.h>
|
||||
#include <support/test-driver.h>
|
||||
|
||||
#if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0
|
||||
@@ -162,7 +163,7 @@ do_test (void)
|
||||
# if _POSIX_MONOTONIC_CLOCK == 0
|
||||
int e = sysconf (_SC_MONOTONIC_CLOCK);
|
||||
if (e < 0)
|
||||
puts ("CLOCK_MONOTONIC not supported");
|
||||
FAIL_UNSUPPORTED ("CLOCK_MONOTONIC not supported");
|
||||
else if (e == 0)
|
||||
{
|
||||
puts ("sysconf (_SC_MONOTONIC_CLOCK) must not return 0");
|
||||
|
||||
Reference in New Issue
Block a user