diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 95839c7915..ae751d2144 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -283,11 +283,11 @@ check_file(const char *file, boolean_t force, boolean_t isspare) char *name; int fd; int ret = 0; - int err; pool_state_t state; boolean_t inuse; - #ifdef HAVE_DM_INUSE_SWAP + int err; + if (dm_inuse_swap(file, &err)) { if (err) libdiskmgt_error(err);