Don't pass empty mount options to nmount(2).

Reviewed by:	pjd
MFC after:	2 weeks
This commit is contained in:
jh 2011-05-03 16:00:26 +00:00
parent 2f3429a5d8
commit e43878f43c

View File

@ -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);