Whamcloud - gitweb
b=21636 diagnostic patch to detect request delay send/reply
[fs/lustre-release.git] / libsysio / tests / test_path.c
index 80cc74e..8776b6e 100644 (file)
@@ -41,8 +41,6 @@
  * lee@sandia.gov
  */
 
-#define _BSD_SOURCE
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <sys/uio.h>
+#include <getopt.h>
 
+#if defined(SYSIO_LABEL_NAMES)
+#include "sysio.h"
+#endif
 #include "xtio.h"
 #include "test.h"
 
@@ -149,7 +151,7 @@ statit(const char *path)
        /*
         * Get file attrs.
         */
-       err = lstat(path, &stbuf);
+       err = SYSIO_INTERFACE_NAME(lstat)(path, &stbuf);
        if (err) {
                perror(path);
                return -1;
@@ -197,7 +199,7 @@ statit(const char *path)
         * Print path and type.
         */
        if (S_ISLNK(stbuf.st_mode)) {
-               cc = readlink(path, buf, sizeof(buf));
+               cc = SYSIO_INTERFACE_NAME(readlink)(path, buf, sizeof(buf));
                if (cc < 0) {
                        perror(path);
                        return -1;
@@ -205,7 +207,7 @@ statit(const char *path)
        }
        (void )printf("%s: %c", path, t);
        if (S_ISLNK(stbuf.st_mode) && (size_t )cc < sizeof(buf))
-               (void )printf(" %.*s", cc, buf);
+               (void )printf(" %.*s", (int )cc, buf);
        (void )putchar('\n');
 
        return 0;