diff options
author | pjd <pjd@FreeBSD.org> | 2010-09-13 08:56:07 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-09-13 08:56:07 +0000 |
commit | 6f96b7c2288e6972fad73b42080d841231294cae (patch) | |
tree | 4675ae936d21184a722c23122b0256934f486ced /sys/geom | |
parent | ab04d6fe3f3cad0bec4d257b1064f6959ac9d358 (diff) | |
download | FreeBSD-src-6f96b7c2288e6972fad73b42080d841231294cae.zip FreeBSD-src-6f96b7c2288e6972fad73b42080d841231294cae.tar.gz |
- Allow to specify value as const pointers.
- Make optional string values always an empty string.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/eli/g_eli_ctl.c | 2 | ||||
-rw-r--r-- | sys/geom/mirror/g_mirror_ctl.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/geom/eli/g_eli_ctl.c b/sys/geom/eli/g_eli_ctl.c index 558a4f2..1d0dddf 100644 --- a/sys/geom/eli/g_eli_ctl.c +++ b/sys/geom/eli/g_eli_ctl.c @@ -269,7 +269,7 @@ g_eli_ctl_onetime(struct gctl_req *req, struct g_class *mp) gctl_error(req, "No '%s' argument.", "aalgo"); return; } - if (strcmp(name, "none") != 0) { + if (*name != '\0') { md.md_aalgo = g_eli_str2aalgo(name); if (md.md_aalgo >= CRYPTO_ALGORITHM_MIN && md.md_aalgo <= CRYPTO_ALGORITHM_MAX) { diff --git a/sys/geom/mirror/g_mirror_ctl.c b/sys/geom/mirror/g_mirror_ctl.c index 4524a90..dc59e18 100644 --- a/sys/geom/mirror/g_mirror_ctl.c +++ b/sys/geom/mirror/g_mirror_ctl.c @@ -192,7 +192,7 @@ g_mirror_ctl_configure(struct gctl_req *req, struct g_class *mp) gctl_error(req, "No such device: %s.", name); return; } - if (strcmp(balancep, "none") == 0) + if (*balancep == '\0') balance = sc->sc_balance; else { if (balance_id(balancep) == -1) { @@ -215,7 +215,7 @@ g_mirror_ctl_configure(struct gctl_req *req, struct g_class *mp) /* Enforce usage() of -p not allowing any other options. */ if (do_priority && (*autosync || *noautosync || *failsync || *nofailsync || *hardcode || *dynamic || *slicep != -1 || - strcmp(balancep, "none") != 0)) { + *balancep != '\0')) { sx_xunlock(&sc->sc_lock); gctl_error(req, "only -p accepted when setting priority"); return; |