Don't print the nmount(2) provided error message if it is empty.

This commit is contained in:
Jaakko Heinonen 2012-01-20 12:59:12 +00:00
parent 72fc1aafe2
commit f3ee32b285
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230377

View File

@ -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);