From: Dmitry V. Levin Date: Wed, 6 Jan 2016 11:25:47 +0000 (+0000) Subject: tests/sched_xetattr.c: use libtests X-Git-Tag: v4.12~706 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05a27ea2f64aa509c7cbbedbb8158e6db787d66f;p=strace tests/sched_xetattr.c: use libtests * tests/sched_xetattr.c: Use SKIP_MAIN_UNDEFINED. (main) Use perror_msg_and_skip. --- diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index 02061f47..c06e9b26 100644 --- a/tests/sched_xetattr.c +++ b/tests/sched_xetattr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,13 +26,14 @@ */ #include "tests.h" -#include -#include -#include #include #if defined __NR_sched_getattr && defined __NR_sched_setattr +# include +# include +# include + int main(void) { @@ -51,7 +52,7 @@ main(void) } sched; if (syscall(__NR_sched_getattr, 0, &sched, sizeof(sched), 0)) - return 77; + perror_msg_and_skip("sched_getattr"); printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+, sched_flags=%s, sched_nice=%u, sched_priority=%u, sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, 256, 0\\) += 0\n", sched.attr.size, @@ -64,7 +65,7 @@ main(void) sched.attr.sched_flags |= 1; if (syscall(__NR_sched_setattr, 0, &sched, 0)) - return 77; + perror_msg_and_skip("sched_setattr"); printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+, sched_flags=%s, sched_nice=%u, sched_priority=%u, sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", sched.attr.size, @@ -80,10 +81,6 @@ main(void) #else -int -main(void) -{ - return 77; -} +SKIP_MAIN_UNDEFINED("__NR_sched_getattr && __NR_sched_setattr") #endif