summaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r--lib/libzfs/libzfs_pool.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 67db13401..b05c1564e 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -23,6 +23,7 @@
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright 2016 Igor Kozhukhov <[email protected]>
*/
#include <ctype.h>
@@ -180,8 +181,6 @@ char *
zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
{
switch (state) {
- default:
- break;
case VDEV_STATE_CLOSED:
case VDEV_STATE_OFFLINE:
return (gettext("OFFLINE"));
@@ -200,6 +199,9 @@ zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
return (gettext("DEGRADED"));
case VDEV_STATE_HEALTHY:
return (gettext("ONLINE"));
+
+ default:
+ break;
}
return (gettext("UNKNOWN"));
@@ -516,8 +518,6 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
* Perform additional checking for specific properties.
*/
switch (prop) {
- default:
- break;
case ZPOOL_PROP_VERSION:
if (intval < version ||
!SPA_VERSION_IS_SUPPORTED(intval)) {
@@ -679,6 +679,10 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
goto error;
}
+
+ default:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "property '%s'(%d) not defined"), propname, prop);
break;
}
}
@@ -998,6 +1002,10 @@ zpool_name_valid(libzfs_handle_t *hdl, boolean_t isopen, const char *pool)
case NAME_ERR_NO_AT:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"permission set is missing '@'"));
+
+ default:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "(%d) not defined"), why);
break;
}
}