diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-11-29 00:46:30 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-11-29 00:46:30 +0000 |
commit | 4b45e66076507a3638626842671242b4edaf2598 (patch) | |
tree | b087558bab3a70991702efc604869d9227b14668 | |
parent | 3b28652c82f9aedcf02bfd8cf9c95b3f60023ca8 (diff) | |
download | FreeBSD-src-4b45e66076507a3638626842671242b4edaf2598.zip FreeBSD-src-4b45e66076507a3638626842671242b4edaf2598.tar.gz |
Pass a string buffer named "errmsg" to nmount().
This will allow the NFS mount code to return a string error message
in addition to returning an error integer value.
Reviewed by: mohans
MFC after: 1 month
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 6907b27..f6af363 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -254,7 +254,7 @@ main(int argc, char *argv[]) int mntflags, altflags, num; int iovlen; char *name, *p, *spec, *fstype; - char mntpath[MAXPATHLEN]; + char mntpath[MAXPATHLEN], errmsg[255]; mntflags = 0; altflags = 0; @@ -262,6 +262,7 @@ main(int argc, char *argv[]) nfsargsp = &nfsargs; iov = NULL; iovlen = 0; + memset(errmsg, 0, sizeof(errmsg)); fstype = strrchr(argv[0], '_'); if (fstype == NULL) @@ -469,9 +470,10 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "nfs_args", nfsargsp, sizeof(*nfsargsp)); build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); if (nmount(iov, iovlen, mntflags)) - err(1, "%s", mntpath); + err(1, "%s, %s", mntpath, errmsg); exit(0); } |