Whamcloud - gitweb
LU-8127 lfsck: remove XATTR_NAME_LFSCK_NAMESPACE_OLD
[fs/lustre-release.git] / lustre / tests / llapi_fid_test.c
index 6d08f61..be38a6c 100644 (file)
@@ -42,6 +42,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <poll.h>
+#include <sys/ioctl.h>
 #include <time.h>
 
 #include <lustre/lustreapi.h>
@@ -92,7 +93,10 @@ static void cleanup(void)
        rc = snprintf(cmd, sizeof(cmd), "rm -rf -- '%s'", mainpath);
        ASSERTF(rc > 0 && rc < sizeof(cmd),
                "invalid delete command for path '%s'", mainpath);
-       system(cmd);
+       rc = system(cmd);
+       ASSERTF(rc != -1, "Cannot execute rm command");
+       ASSERTF(WEXITSTATUS(rc) == 0,
+               "rm command returned %d", WEXITSTATUS(rc));
 }
 
 /* Helper - call path2fid, fd2fid and fid2path against an existing
@@ -102,7 +106,7 @@ static void helper_fid2path(const char *filename, int fd)
        lustre_fid fid;
        lustre_fid fid2;
        lustre_fid fid3;
-       char fidstr[FID_LEN];
+       char fidstr[FID_LEN + 1];
        char path1[PATH_MAX];
        char path2[PATH_MAX];
        char path3[PATH_MAX];
@@ -238,7 +242,7 @@ static void test11(void)
        int rc;
        int fd;
        lustre_fid fid;
-       char fidstr[FID_LEN];
+       char fidstr[FID_LEN + 1];
        char path[PATH_MAX];
        long long recno;
        int linkno;
@@ -368,7 +372,7 @@ static void test30(void)
        char buf[PATH_MAX];
        char buf2[PATH_MAX];
        lustre_fid fid;
-       char fidstr[FID_LEN];
+       char fidstr[FID_LEN + 1];
        int rc;
        int i;
        int j;
@@ -695,7 +699,7 @@ static void process_args(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-       char fsname[8];
+       char fsname[8 + 1];
        int rc;
 
        process_args(argc, argv);