Deleted Added
full compact
mounttab.c (80146) mounttab.c (81070)
1/*
2 * Copyright (c) 1999 Martin Blapp
3 * 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

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

22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#ifndef lint
29static const char rcsid[] =
1/*
2 * Copyright (c) 1999 Martin Blapp
3 * 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

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

22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#ifndef lint
29static const char rcsid[] =
30 "$FreeBSD: head/usr.sbin/rpc.umntall/mounttab.c 80146 2001-07-22 12:17:51Z iedowse $";
30 "$FreeBSD: head/usr.sbin/rpc.umntall/mounttab.c 81070 2001-08-02 21:46:21Z iedowse $";
31#endif /* not lint */
32
33#include <sys/syslog.h>
34
35#include <rpc/rpc.h>
36#include <nfs/rpcv2.h>
37
38#include <err.h>

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

184void
185clean_mtab(char *hostp, char *dirp, int verbose) {
186 struct mtablist *mtabp;
187 char *host;
188
189 /* Copy hostp in case it points to an entry that we are zeroing out. */
190 host = strdup(hostp);
191 for (mtabp = mtabhead; mtabp != NULL; mtabp = mtabp->mtab_next) {
31#endif /* not lint */
32
33#include <sys/syslog.h>
34
35#include <rpc/rpc.h>
36#include <nfs/rpcv2.h>
37
38#include <err.h>

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

184void
185clean_mtab(char *hostp, char *dirp, int verbose) {
186 struct mtablist *mtabp;
187 char *host;
188
189 /* Copy hostp in case it points to an entry that we are zeroing out. */
190 host = strdup(hostp);
191 for (mtabp = mtabhead; mtabp != NULL; mtabp = mtabp->mtab_next) {
192 if (strcmp(mtabp->mtab_host, hostp) != 0)
192 if (strcmp(mtabp->mtab_host, host) != 0)
193 continue;
194 if (dirp != NULL && strcmp(mtabp->mtab_dirp, dirp) != 0)
195 continue;
196
197 if (verbose)
198 warnx("delete mounttab entry%s %s:%s",
199 (dirp == NULL) ? " by host" : "",
200 mtabp->mtab_host, mtabp->mtab_dirp);

--- 26 unchanged lines hidden ---
193 continue;
194 if (dirp != NULL && strcmp(mtabp->mtab_dirp, dirp) != 0)
195 continue;
196
197 if (verbose)
198 warnx("delete mounttab entry%s %s:%s",
199 (dirp == NULL) ? " by host" : "",
200 mtabp->mtab_host, mtabp->mtab_dirp);

--- 26 unchanged lines hidden ---