From f3ee32b285ef72f3a735f8446919345c385cfe9c Mon Sep 17 00:00:00 2001 From: Jaakko Heinonen Date: Fri, 20 Jan 2012 12:59:12 +0000 Subject: [PATCH] Don't print the nmount(2) provided error message if it is empty. --- sbin/mount/mount_fs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/mount/mount_fs.c b/sbin/mount/mount_fs.c index fd7b529d4bb..385cd0fb563 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);