From 578cfbaae8bf26b839069304a941824bf476d7f8 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Mon, 29 Jan 2007 01:49:08 +0000 Subject: [PATCH] Pass "errmsg" to nmount(), so that if nmount() fails, we can get strings provided by vfs_mount_error(). --- sbin/mount_msdosfs/mount_msdosfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c index e0c056a7d931..8947644d152c 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.c +++ b/sbin/mount_msdosfs/mount_msdosfs.c @@ -72,6 +72,7 @@ main(int argc, char **argv) int c, mntflags, set_gid, set_uid, set_mask, set_dirmask; char *dev, *dir, mntpath[MAXPATHLEN], *csp; char fstype[] = "msdosfs"; + char errmsg[255] = {0}; char *cs_dos = NULL; char *cs_local = NULL; mode_t mask = 0, dirmask = 0; @@ -211,13 +212,14 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); build_iovec_argf(&iov, &iovlen, "uid", "%d", uid); build_iovec_argf(&iov, &iovlen, "gid", "%u", gid); build_iovec_argf(&iov, &iovlen, "mask", "%u", mask); build_iovec_argf(&iov, &iovlen, "dirmask", "%u", dirmask); if (nmount(iov, iovlen, mntflags) < 0) - err(1, "%s", dev); + err(1, "%s: %s", dev, errmsg); exit (0); }