X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fzdb%2Fzdb.c;h=2f5f19e22dd4164ab9daedb86ffa4f52c666defd;hb=ca8b5af89d2c5826af7385bf18f3b377b0efde11;hp=459445bb729d2eeeaf5ab6ada739f7acc43ad236;hpb=d4ed667343c3dac114642b9f6cb4f7baa3ff7334;p=zfs.git diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 459445b..2f5f19e 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -55,7 +55,6 @@ #include #include #undef ZFS_MAXNAMELEN -#undef verify #include #define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ @@ -1804,7 +1803,7 @@ dump_label(const char *dev) exit(1); } - if (fstat64(fd, &statbuf) != 0) { + if (fstat64_blk(fd, &statbuf) != 0) { (void) printf("failed to stat '%s': %s\n", path, strerror(errno)); free(path); @@ -1812,14 +1811,6 @@ dump_label(const char *dev) exit(1); } - if (S_ISBLK(statbuf.st_mode)) { - (void) printf("cannot use '%s': character device required\n", - path); - free(path); - (void) close(fd); - exit(1); - } - psize = statbuf.st_size; psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t)); @@ -3037,8 +3028,8 @@ main(int argc, char **argv) } kernel_init(FREAD); - g_zfs = libzfs_init(); - ASSERT(g_zfs != NULL); + if ((g_zfs = libzfs_init()) == NULL) + return (1); if (dump_all) verbose = MAX(verbose, 1);