summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.umntall
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2009-06-24 18:42:21 +0000
committerdfr <dfr@FreeBSD.org>2009-06-24 18:42:21 +0000
commitec9ddec04ca1bcd7e7bb514dfc6970627ee47872 (patch)
treebbae5223b9078101f704aa848f53e3f5f9e20cd7 /usr.sbin/rpc.umntall
parent6c60345b340131c66e68bbef66500d1f0eefb556 (diff)
downloadFreeBSD-src-ec9ddec04ca1bcd7e7bb514dfc6970627ee47872.zip
FreeBSD-src-ec9ddec04ca1bcd7e7bb514dfc6970627ee47872.tar.gz
Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.
Diffstat (limited to 'usr.sbin/rpc.umntall')
-rw-r--r--usr.sbin/rpc.umntall/mounttab.c12
-rw-r--r--usr.sbin/rpc.umntall/mounttab.h6
-rw-r--r--usr.sbin/rpc.umntall/rpc.umntall.c20
3 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/rpc.umntall/mounttab.c b/usr.sbin/rpc.umntall/mounttab.c
index b81334e..9d7fe2f 100644
--- a/usr.sbin/rpc.umntall/mounttab.c
+++ b/usr.sbin/rpc.umntall/mounttab.c
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/syslog.h>
#include <rpc/rpc.h>
-#include <nfs/rpcv2.h>
+#include <rpcsvc/mount.h>
#include <err.h>
#include <errno.h>
@@ -120,10 +120,10 @@ read_mtab() {
return (0);
}
mtabp->mtab_time = time;
- memmove(mtabp->mtab_host, hostp, RPCMNT_NAMELEN);
- mtabp->mtab_host[RPCMNT_NAMELEN - 1] = '\0';
- memmove(mtabp->mtab_dirp, dirp, RPCMNT_PATHLEN);
- mtabp->mtab_dirp[RPCMNT_PATHLEN - 1] = '\0';
+ memmove(mtabp->mtab_host, hostp, MNTNAMLEN);
+ mtabp->mtab_host[MNTNAMLEN - 1] = '\0';
+ memmove(mtabp->mtab_dirp, dirp, MNTPATHLEN);
+ mtabp->mtab_dirp[MNTPATHLEN - 1] = '\0';
mtabp->mtab_next = (struct mtablist *)NULL;
*mtabpp = mtabp;
mtabpp = &mtabp->mtab_next;
@@ -196,7 +196,7 @@ clean_mtab(char *hostp, char *dirp, int verbose) {
warnx("delete mounttab entry%s %s:%s",
(dirp == NULL) ? " by host" : "",
mtabp->mtab_host, mtabp->mtab_dirp);
- bzero(mtabp->mtab_host, RPCMNT_NAMELEN);
+ bzero(mtabp->mtab_host, MNTNAMLEN);
}
free(host);
}
diff --git a/usr.sbin/rpc.umntall/mounttab.h b/usr.sbin/rpc.umntall/mounttab.h
index acf6c79..9999b03 100644
--- a/usr.sbin/rpc.umntall/mounttab.h
+++ b/usr.sbin/rpc.umntall/mounttab.h
@@ -26,14 +26,14 @@
* $FreeBSD$
*/
-#define STRSIZ (RPCMNT_NAMELEN+RPCMNT_PATHLEN+100)
+#define STRSIZ (MNTNAMLEN+MNTPATHLEN+100)
#define PATH_MOUNTTAB "/var/db/mounttab"
/* Structure for /var/db/mounttab */
struct mtablist {
time_t mtab_time;
- char mtab_host[RPCMNT_NAMELEN];
- char mtab_dirp[RPCMNT_PATHLEN];
+ char mtab_host[MNTNAMLEN];
+ char mtab_dirp[MNTPATHLEN];
struct mtablist *mtab_next;
};
diff --git a/usr.sbin/rpc.umntall/rpc.umntall.c b/usr.sbin/rpc.umntall/rpc.umntall.c
index b79e478..a64fae6 100644
--- a/usr.sbin/rpc.umntall/rpc.umntall.c
+++ b/usr.sbin/rpc.umntall/rpc.umntall.c
@@ -35,7 +35,7 @@ static const char rcsid[] =
#include <sys/mount.h>
#include <rpc/rpc.h>
-#include <nfs/rpcv2.h>
+#include <rpcsvc/mount.h>
#include <err.h>
#include <netdb.h>
@@ -176,18 +176,18 @@ do_umntall(char *hostname) {
try.tv_sec = 3;
try.tv_usec = 0;
- clp = clnt_create_timed(hostname, RPCPROG_MNT, RPCMNT_VER1, "udp",
+ clp = clnt_create_timed(hostname, MOUNTPROG, MOUNTVERS, "udp",
&try);
if (clp == NULL) {
- warnx("%s: %s", hostname, clnt_spcreateerror("RPCPROG_MNT"));
+ warnx("%s: %s", hostname, clnt_spcreateerror("MOUNTPROG"));
return (0);
}
clp->cl_auth = authunix_create_default();
- clnt_stat = clnt_call(clp, RPCMNT_UMNTALL,
+ clnt_stat = clnt_call(clp, MOUNTPROC_UMNTALL,
(xdrproc_t)xdr_void, (caddr_t)0,
(xdrproc_t)xdr_void, (caddr_t)0, try);
if (clnt_stat != RPC_SUCCESS)
- warnx("%s: %s", hostname, clnt_sperror(clp, "RPCMNT_UMNTALL"));
+ warnx("%s: %s", hostname, clnt_sperror(clp, "MOUNTPROC_UMNTALL"));
auth_destroy(clp->cl_auth);
clnt_destroy(clp);
return (clnt_stat == RPC_SUCCESS);
@@ -204,17 +204,17 @@ do_umount(char *hostname, char *dirp) {
try.tv_sec = 3;
try.tv_usec = 0;
- clp = clnt_create_timed(hostname, RPCPROG_MNT, RPCMNT_VER1, "udp",
+ clp = clnt_create_timed(hostname, MOUNTPROG, MOUNTVERS, "udp",
&try);
if (clp == NULL) {
- warnx("%s: %s", hostname, clnt_spcreateerror("RPCPROG_MNT"));
+ warnx("%s: %s", hostname, clnt_spcreateerror("MOUNTPROG"));
return (0);
}
clp->cl_auth = authsys_create_default();
- clnt_stat = clnt_call(clp, RPCMNT_UMOUNT, (xdrproc_t)xdr_dir, dirp,
+ clnt_stat = clnt_call(clp, MOUNTPROC_UMNT, (xdrproc_t)xdr_dir, dirp,
(xdrproc_t)xdr_void, (caddr_t)0, try);
if (clnt_stat != RPC_SUCCESS)
- warnx("%s: %s", hostname, clnt_sperror(clp, "RPCMNT_UMOUNT"));
+ warnx("%s: %s", hostname, clnt_sperror(clp, "MOUNTPROC_UMNT"));
auth_destroy(clp->cl_auth);
clnt_destroy(clp);
return (clnt_stat == RPC_SUCCESS);
@@ -255,7 +255,7 @@ is_mounted(char *hostname, char *dirp) {
*/
int
xdr_dir(XDR *xdrsp, char *dirp) {
- return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN));
+ return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
}
static void
OpenPOWER on IntegriCloud