From 4b86fdbd5fb52e02c52f67f5dc954e72c9ea51d6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 5 Jan 2016 23:26:13 +0000 Subject: [PATCH] tests/readlink.c: use libtests * tests/readlink.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- tests/readlink.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/readlink.c b/tests/readlink.c index 76bab319..7bbec220 100644 --- a/tests/readlink.c +++ b/tests/readlink.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_readlink + +# include +# include + int main(void) { -#ifdef __NR_readlink static const char fname[] = "readlink.link"; unsigned char buf[31]; long rc; @@ -42,7 +44,7 @@ main(void) rc = syscall(__NR_readlink, fname, buf, sizeof(buf)); if (rc < 0) - return 77; + perror_msg_and_skip("readlink"); printf("readlink(\""); 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_readlink") + #endif -} -- 2.40.0