summaryrefslogtreecommitdiffstats
path: root/sbin/mount
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2012-01-20 12:59:12 +0000
committerjh <jh@FreeBSD.org>2012-01-20 12:59:12 +0000
commitaa672f6fe741d120808f64e9b2ecc721342dd2fb (patch)
tree80b1f021dee879962d1a6aa0db9cb49e2ebadcdf /sbin/mount
parent0db22183d968255ca6861d6d13e0e471be4efedc (diff)
downloadFreeBSD-src-aa672f6fe741d120808f64e9b2ecc721342dd2fb.zip
FreeBSD-src-aa672f6fe741d120808f64e9b2ecc721342dd2fb.tar.gz
Don't print the nmount(2) provided error message if it is empty.
Diffstat (limited to 'sbin/mount')
-rw-r--r--sbin/mount/mount_fs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/mount/mount_fs.c b/sbin/mount/mount_fs.c
index fd7b529..385cd0f 100644
--- a/sbin/mount/mount_fs.c
+++ b/sbin/mount/mount_fs.c
@@ -129,7 +129,10 @@ mount_fs(const char *vfstype, int argc, char *argv[])
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
if (nmount(iov, iovlen, mntflags) == -1) {
- warn("%s: %s", dev, errmsg);
+ if (*errmsg != '\0')
+ warn("%s: %s", dev, errmsg);
+ else
+ warn("%s", dev);
return (1);
}
return (0);
OpenPOWER on IntegriCloud