From: Dmitry V. Levin Date: Tue, 5 Jan 2016 23:27:05 +0000 (+0000) Subject: tests/readlinkat.c: use libtests X-Git-Tag: v4.12~725 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f6a552e1e60c0e05651978a6bcec1d171a897ef;p=strace tests/readlinkat.c: use libtests * tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- diff --git a/tests/readlinkat.c b/tests/readlinkat.c index ccfc32da..67cefe99 100644 --- a/tests/readlinkat.c +++ b/tests/readlinkat.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * 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 @@ -27,14 +27,16 @@ */ #include "tests.h" -#include -#include #include +#ifdef __NR_readlinkat + +# include +# include + int main(void) { -#ifdef __NR_readlinkat static const char fname[] = "readlinkat.link"; unsigned char buf[31]; long rc; @@ -42,7 +44,7 @@ main(void) rc = syscall(__NR_readlinkat, -100, fname, buf, sizeof(buf)); if (rc < 0) - return 77; + perror_msg_and_skip("readlinkat"); printf("readlinkat(AT_FDCWD, \""); for (i = 0; fname[i]; ++i) @@ -54,7 +56,10 @@ main(void) puts("+++ exited with 0 +++"); return 0; +} + #else - return 77; + +SKIP_MAIN_UNDEFINED("__NR_readlinkat") + #endif -}