aboutsummaryrefslogtreecommitdiff
path: root/cddl/compat/opensolaris/misc/zmount.c
diff options
context:
space:
mode:
authorJaakko Heinonen <jh@FreeBSD.org>2011-05-03 16:00:26 +0000
committerJaakko Heinonen <jh@FreeBSD.org>2011-05-03 16:00:26 +0000
commit26a8da6632833fd7dc6fa6424f5ac29db56edc03 (patch)
tree7225007572f854688f41bdc9e01eed98d1983b8a /cddl/compat/opensolaris/misc/zmount.c
parent040b46f5ba1fb23f633535985be51c39ac0c876e (diff)
downloadsrc-26a8da6632833fd7dc6fa6424f5ac29db56edc03.tar.gz
src-26a8da6632833fd7dc6fa6424f5ac29db56edc03.zip
Don't pass empty mount options to nmount(2).
Reviewed by: pjd MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=221390
Diffstat (limited to 'cddl/compat/opensolaris/misc/zmount.c')
-rw-r--r--cddl/compat/opensolaris/misc/zmount.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cddl/compat/opensolaris/misc/zmount.c b/cddl/compat/opensolaris/misc/zmount.c
index b4f99e3be9fd..d46b378ea92a 100644
--- a/cddl/compat/opensolaris/misc/zmount.c
+++ b/cddl/compat/opensolaris/misc/zmount.c
@@ -98,8 +98,10 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype,
build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir),
(size_t)-1);
build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1);
- for (p = optstr; p != NULL; strsep(&p, ",/ "))
- build_iovec(&iov, &iovlen, p, NULL, (size_t)-1);
+ for (p = optstr; p != NULL; strsep(&p, ",/ ")) {
+ if (*p != '\0')
+ build_iovec(&iov, &iovlen, p, NULL, (size_t)-1);
+ }
rv = nmount(iov, iovlen, 0);
free(optstr);
return (rv);