]> granicus.if.org Git - strace/commitdiff
tests/getdents.c: use libtests
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jan 2016 12:02:55 +0000 (12:02 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jan 2016 12:02:55 +0000 (12:02 +0000)
* tests/getdents.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_skip.

tests/getdents.c

index eee91a97e2e1f9ef99c91aec047426c2abc1e0d5..16541df6fe76d4f22f692d85adf6f6a6ed41361b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 #ifdef __NR_getdents
 
-#include <assert.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "kernel_types.h"
+# include <assert.h>
+# include <dirent.h>
+# include <fcntl.h>
+# include <stddef.h>
+# include <stdio.h>
+# include <sys/stat.h>
+# include <unistd.h>
+# include "kernel_types.h"
 
 static const char fname[] =
        "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n"
@@ -112,7 +111,7 @@ main(int ac, const char **av)
                int i;
 
                if (rc < 0)
-                       return 77;
+                       perror_msg_and_skip("getdents");
                printf("getdents(0, [");
                for (i = 0; i < rc; i += d->d_reclen) {
                        d = (kernel_dirent *) &buf[i];
@@ -133,10 +132,6 @@ main(int ac, const char **av)
 
 #else
 
-int
-main(void)
-{
-       return 77;
-}
+SKIP_MAIN_UNDEFINED("__NR_getdents")
 
 #endif