Deleted Added
full compact
umount.c (80118) umount.c (80146)
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

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

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95";
43#endif
44static 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

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

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95";
43#endif
44static const char rcsid[] =
45 "$FreeBSD: head/sbin/umount/umount.c 80118 2001-07-22 00:45:29Z iedowse $";
45 "$FreeBSD: head/sbin/umount/umount.c 80146 2001-07-22 12:17:51Z iedowse $";
46#endif /* not lint */
47
48#include <sys/param.h>
49#include <sys/mount.h>
50#include <sys/socket.h>
51
52#include <netdb.h>
53#include <rpc/rpc.h>

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

63#include "mounttab.h"
64
65#define ISDOT(x) ((x)[0] == '.' && (x)[1] == '\0')
66#define ISDOTDOT(x) ((x)[0] == '.' && (x)[1] == '.' && (x)[2] == '\0')
67
68typedef enum { MNTON, MNTFROM, NOTHING } mntwhat;
69typedef enum { MARK, UNMARK, NAME, COUNT, FREE } dowhat;
70
46#endif /* not lint */
47
48#include <sys/param.h>
49#include <sys/mount.h>
50#include <sys/socket.h>
51
52#include <netdb.h>
53#include <rpc/rpc.h>

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

63#include "mounttab.h"
64
65#define ISDOT(x) ((x)[0] == '.' && (x)[1] == '\0')
66#define ISDOTDOT(x) ((x)[0] == '.' && (x)[1] == '.' && (x)[2] == '\0')
67
68typedef enum { MNTON, MNTFROM, NOTHING } mntwhat;
69typedef enum { MARK, UNMARK, NAME, COUNT, FREE } dowhat;
70
71struct mtablist *mtabhead;
72struct addrinfo *nfshost_ai = NULL;
73int fflag, vflag;
74char *nfshost;
75
76void checkmntlist (char *, char **, char **, char **);
77int checkvfsname (const char *, char **);
78char *getmntname (const char *, const char *,
79 mntwhat, char **, dowhat);

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

468 if (clnt_stat != RPC_SUCCESS) {
469 warnx("%s: %s", hostp,
470 clnt_sperror(clp, "RPCMNT_UMOUNT"));
471 return (1);
472 }
473 /*
474 * Remove the unmounted entry from /var/db/mounttab.
475 */
71struct addrinfo *nfshost_ai = NULL;
72int fflag, vflag;
73char *nfshost;
74
75void checkmntlist (char *, char **, char **, char **);
76int checkvfsname (const char *, char **);
77char *getmntname (const char *, const char *,
78 mntwhat, char **, dowhat);

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

467 if (clnt_stat != RPC_SUCCESS) {
468 warnx("%s: %s", hostp,
469 clnt_sperror(clp, "RPCMNT_UMOUNT"));
470 return (1);
471 }
472 /*
473 * Remove the unmounted entry from /var/db/mounttab.
474 */
476 if (read_mtab(NULL)) {
477 clean_mtab(hostp, nfsdirname);
478 if(!write_mtab())
475 if (read_mtab()) {
476 clean_mtab(hostp, nfsdirname, vflag);
477 if(!write_mtab(vflag))
479 warnx("cannot remove mounttab entry %s:%s",
480 hostp, nfsdirname);
481 free_mtab();
482 }
483 free(orignfsdirname);
484 auth_destroy(clp->cl_auth);
485 clnt_destroy(clp);
486 }

--- 270 unchanged lines hidden ---
478 warnx("cannot remove mounttab entry %s:%s",
479 hostp, nfsdirname);
480 free_mtab();
481 }
482 free(orignfsdirname);
483 auth_destroy(clp->cl_auth);
484 clnt_destroy(clp);
485 }

--- 270 unchanged lines hidden ---