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

Reviewed by:	pjd
MFC after:	2 weeks
This commit is contained in:
Jaakko Heinonen 2011-05-03 16:00:26 +00:00
parent 040b46f5ba
commit 26a8da6632
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221390

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