Deleted Added
full compact
umount.c (141611) umount.c (194880)
1/*-
2 * Copyright (c) 1980, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 24 unchanged lines hidden (view full) ---

33 The Regents of the University of California. All rights reserved.\n";
34#endif /* not lint */
35
36#ifndef lint
37#if 0
38static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95";
39#endif
40static const char rcsid[] =
1/*-
2 * Copyright (c) 1980, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 24 unchanged lines hidden (view full) ---

33 The Regents of the University of California. All rights reserved.\n";
34#endif /* not lint */
35
36#ifndef lint
37#if 0
38static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95";
39#endif
40static const char rcsid[] =
41 "$FreeBSD: head/sbin/umount/umount.c 141611 2005-02-10 09:19:34Z ru $";
41 "$FreeBSD: head/sbin/umount/umount.c 194880 2009-06-24 18:42:21Z dfr $";
42#endif /* not lint */
43
44#include <sys/param.h>
45#include <sys/mount.h>
46#include <sys/socket.h>
47#include <sys/stat.h>
48
49#include <netdb.h>
50#include <rpc/rpc.h>
42#endif /* not lint */
43
44#include <sys/param.h>
45#include <sys/mount.h>
46#include <sys/socket.h>
47#include <sys/stat.h>
48
49#include <netdb.h>
50#include <rpc/rpc.h>
51#include <nfs/rpcv2.h>
51#include <rpcsvc/mount.h>
52
53#include <ctype.h>
54#include <err.h>
55#include <errno.h>
56#include <fstab.h>
57#include <stdio.h>
58#include <stdlib.h>
59#include <string.h>

--- 314 unchanged lines hidden (view full) ---

374 if (vflag)
375 (void)printf("%s: unmount from %s\n", sfs->f_mntfromname,
376 sfs->f_mntonname);
377 /*
378 * Report to mountd-server which nfsname
379 * has been unmounted.
380 */
381 if (ai != NULL && !(fflag & MNT_FORCE) && do_rpc) {
52
53#include <ctype.h>
54#include <err.h>
55#include <errno.h>
56#include <fstab.h>
57#include <stdio.h>
58#include <stdlib.h>
59#include <string.h>

--- 314 unchanged lines hidden (view full) ---

374 if (vflag)
375 (void)printf("%s: unmount from %s\n", sfs->f_mntfromname,
376 sfs->f_mntonname);
377 /*
378 * Report to mountd-server which nfsname
379 * has been unmounted.
380 */
381 if (ai != NULL && !(fflag & MNT_FORCE) && do_rpc) {
382 clp = clnt_create(hostp, RPCPROG_MNT, RPCMNT_VER1, "udp");
382 clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS, "udp");
383 if (clp == NULL) {
384 warnx("%s: %s", hostp,
383 if (clp == NULL) {
384 warnx("%s: %s", hostp,
385 clnt_spcreateerror("RPCPROG_MNT"));
385 clnt_spcreateerror("MOUNTPROG"));
386 return (1);
387 }
388 clp->cl_auth = authsys_create_default();
389 try.tv_sec = 20;
390 try.tv_usec = 0;
386 return (1);
387 }
388 clp->cl_auth = authsys_create_default();
389 try.tv_sec = 20;
390 try.tv_usec = 0;
391 clnt_stat = clnt_call(clp, RPCMNT_UMOUNT, (xdrproc_t)xdr_dir,
391 clnt_stat = clnt_call(clp, MOUNTPROC_UMNT, (xdrproc_t)xdr_dir,
392 nfsdirname, (xdrproc_t)xdr_void, (caddr_t)0, try);
393 if (clnt_stat != RPC_SUCCESS) {
394 warnx("%s: %s", hostp,
395 clnt_sperror(clp, "RPCMNT_UMOUNT"));
396 return (1);
397 }
398 /*
399 * Remove the unmounted entry from /var/db/mounttab.

--- 178 unchanged lines hidden (view full) ---

578
579/*
580 * xdr routines for mount rpc's
581 */
582int
583xdr_dir(XDR *xdrsp, char *dirp)
584{
585
392 nfsdirname, (xdrproc_t)xdr_void, (caddr_t)0, try);
393 if (clnt_stat != RPC_SUCCESS) {
394 warnx("%s: %s", hostp,
395 clnt_sperror(clp, "RPCMNT_UMOUNT"));
396 return (1);
397 }
398 /*
399 * Remove the unmounted entry from /var/db/mounttab.

--- 178 unchanged lines hidden (view full) ---

578
579/*
580 * xdr routines for mount rpc's
581 */
582int
583xdr_dir(XDR *xdrsp, char *dirp)
584{
585
586 return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN));
586 return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
587}
588
589void
590usage()
591{
592
593 (void)fprintf(stderr, "%s\n%s\n",
594 "usage: umount [-fv] special | node | fsid",
595 " umount -a | -A [-F fstab] [-fv] [-h host] [-t type]");
596 exit(1);
597}
587}
588
589void
590usage()
591{
592
593 (void)fprintf(stderr, "%s\n%s\n",
594 "usage: umount [-fv] special | node | fsid",
595 " umount -a | -A [-F fstab] [-fv] [-h host] [-t type]");
596 exit(1);
597}