diff options
author | John Levon <john.levon@joyent.com> | 2020-08-13 15:27:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 15:27:11 +0100 |
commit | e63d036fd36b5642d5e199f7d9895d8d4eda6072 (patch) | |
tree | 0c177a62e8bd3796a7b530b7520fb0a4e7d0cd56 /usr/src/lib/libzutil/common | |
parent | a8ff5009e5f7ea544c79b60ea65577f19304ff0b (diff) | |
parent | 09f210323354e07890b312da9b4f5e33ae6b6df5 (diff) | |
download | illumos-joyent-sasinfo.tar.gz |
Merge branch 'master' into sasinfosasinfo
Diffstat (limited to 'usr/src/lib/libzutil/common')
-rw-r--r-- | usr/src/lib/libzutil/common/zutil_import.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr/src/lib/libzutil/common/zutil_import.c b/usr/src/lib/libzutil/common/zutil_import.c index 961247c5c0..b4e6ccc0ca 100644 --- a/usr/src/lib/libzutil/common/zutil_import.c +++ b/usr/src/lib/libzutil/common/zutil_import.c @@ -25,6 +25,7 @@ * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright 2015 RackTop Systems. * Copyright (c) 2016, Intel Corporation. + * Copyright 2020 Joyent, Inc. */ /* @@ -913,8 +914,11 @@ zpool_read_label(int fd, nvlist_t **config, int *num_labels) *config = NULL; + if (num_labels != NULL) + *num_labels = 0; + if (fstat64(fd, &statbuf) == -1) - return (-1); + return (0); size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t); if ((label = malloc(sizeof (vdev_label_t))) == NULL) @@ -968,11 +972,6 @@ zpool_read_label(int fd, nvlist_t **config, int *num_labels) free(label); *config = expected_config; - if (count == 0) { - errno = ENOENT; - return (-1); - } - return (0); } |