From 773e56519d82be8cfc10d1a917b43aaddb542e31 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Wed, 22 Jul 2015 22:53:40 +0000 Subject: [PATCH] mount_nfs: Be more clear on nmount(2) error with errmsg unset Differential Revision: https://reviews.freebsd.org/D3147 Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- sbin/mount_nfs/mount_nfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 836bc87daa48..810cf59da0c4 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -476,7 +476,8 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); if (nmount(iov, iovlen, 0)) - err(1, "%s, %s", mntpath, errmsg); + err(1, "nmount: %s%s%s", mntpath, errmsg[0] ? ", " : "", + errmsg); exit(0); }