Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 May 2011 16:00:26 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221390 - head/cddl/compat/opensolaris/misc
Message-ID:  <201105031600.p43G0QiD001107@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Tue May  3 16:00:26 2011
New Revision: 221390
URL: http://svn.freebsd.org/changeset/base/221390

Log:
  Don't pass empty mount options to nmount(2).
  
  Reviewed by:	pjd
  MFC after:	2 weeks

Modified:
  head/cddl/compat/opensolaris/misc/zmount.c

Modified: head/cddl/compat/opensolaris/misc/zmount.c
==============================================================================
--- head/cddl/compat/opensolaris/misc/zmount.c	Tue May  3 15:58:24 2011	(r221389)
+++ head/cddl/compat/opensolaris/misc/zmount.c	Tue May  3 16:00:26 2011	(r221390)
@@ -98,8 +98,10 @@ zmount(const char *spec, const char *dir
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105031600.p43G0QiD001107>