Index: sbin/mksnap_ffs/mksnap_ffs.c
===================================================================
RCS file: /home/ncvs/src/sbin/mksnap_ffs/mksnap_ffs.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- sbin/mksnap_ffs/mksnap_ffs.c	4 Nov 2003 07:04:01 -0000	1.5
+++ sbin/mksnap_ffs/mksnap_ffs.c	27 Jan 2004 19:33:06 -0000	1.5.2.1
@@ -32,7 +32,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sbin/mksnap_ffs/mksnap_ffs.c,v 1.5 2003/11/04 07:04:01 mckusick Exp $
+ * $FreeBSD: src/sbin/mksnap_ffs/mksnap_ffs.c,v 1.5.2.1 2004/01/27 19:33:06 des Exp $
  */
 
 #include <sys/param.h>
@@ -56,6 +56,7 @@
 main(int argc, char **argv)
 {
 	char *dir, *cp, path[PATH_MAX];
+	struct statfs stfsbuf;
 	struct ufs_args args;
 	struct group *grp;
 	struct stat stbuf;
@@ -85,6 +86,8 @@
 	} else {
 		strlcpy(path, args.fspec, cp - args.fspec + 1);
 	}
+	if (statfs(path, &stfsbuf) < 0)
+		err(1, "%s", path);
 	if (stat(path, &stbuf) < 0)
 		err(1, "%s", path);
 	if (!S_ISDIR(stbuf.st_mode))
@@ -100,7 +103,8 @@
 	 */
 	if ((grp = getgrnam("operator")) == NULL)
 		errx(1, "Cannot retrieve operator gid");
-	if (mount("ffs", dir, MNT_UPDATE | MNT_SNAPSHOT, &args) < 0)
+	if (mount("ffs", dir, MNT_UPDATE | MNT_SNAPSHOT | stfsbuf.f_flags,
+	    &args) < 0)
 		err(1, "Cannot create %s", args.fspec);
 	if ((fd = open(args.fspec, O_RDONLY)) < 0)
 		err(1, "Cannot open %s", args.fspec);
