From aa672f6fe741d120808f64e9b2ecc721342dd2fb Mon Sep 17 00:00:00 2001 From: jh Date: Fri, 20 Jan 2012 12:59:12 +0000 Subject: 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(-) (limited to 'sbin/mount') 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); -- cgit v1.1