Linux 3.6 compat, iops->create()
[zfs.git] / cmd / ztest / ztest.c
index bc2f56f..4479c59 100644 (file)
@@ -729,14 +729,17 @@ process_options(int argc, char **argv)
            UINT64_MAX >> 2);
 
        if (strlen(altdir) > 0) {
-               char cmd[MAXNAMELEN];
-               char realaltdir[MAXNAMELEN];
+               char *cmd;
+               char *realaltdir;
                char *bin;
                char *ztest;
                char *isa;
                int isalen;
 
-               (void) realpath(getexecname(), cmd);
+               cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
+               realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
+
+               VERIFY(NULL != realpath(getexecname(), cmd));
                if (0 != access(altdir, F_OK)) {
                        ztest_dump_core = B_FALSE;
                        fatal(B_TRUE, "invalid alternate ztest path: %s",
@@ -767,6 +770,9 @@ process_options(int argc, char **argv)
                        fatal(B_TRUE, "invalid alternate lib directory %s",
                            zo->zo_alt_libpath);
                }
+
+               umem_free(cmd, MAXPATHLEN);
+               umem_free(realaltdir, MAXPATHLEN);
        }
 }
 
@@ -6030,8 +6036,8 @@ main(int argc, char **argv)
        ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count);
 
        /* Override location of zpool.cache */
-       (void) asprintf((char **)&spa_config_path, "%s/zpool.cache",
-           ztest_opts.zo_dir);
+       VERIFY(asprintf((char **)&spa_config_path, "%s/zpool.cache",
+           ztest_opts.zo_dir) != -1);
 
        ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t),
            UMEM_NOFAIL);