diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2010-09-13 08:56:07 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2010-09-13 08:56:07 +0000 |
commit | a478ea74908024df80e60a025777d0aa23e23a2c (patch) | |
tree | 4675ae936d21184a722c23122b0256934f486ced /sys | |
parent | b7d28b2e0b39e28d5f7f35c66be2ab81de3cc75c (diff) | |
download | src-a478ea74908024df80e60a025777d0aa23e23a2c.tar.gz src-a478ea74908024df80e60a025777d0aa23e23a2c.zip |
- Allow to specify value as const pointers.
- Make optional string values always an empty string.
Notes
Notes:
svn path=/head/; revision=212547
Diffstat (limited to 'sys')
-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 558a4f278f16..1d0dddfffc90 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 4524a90d8dd1..dc59e1851336 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; |