Deleted Added
full compact
mount_nullfs.c (152670) mount_nullfs.c (201227)
1/*
2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

36 The Regents of the University of California. All rights reserved.\n";
37#endif /* not lint */
38
39#ifndef lint
40#if 0
41static char sccsid[] = "@(#)mount_null.c 8.6 (Berkeley) 4/26/95";
42#endif
43static const char rcsid[] =
1/*
2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

36 The Regents of the University of California. All rights reserved.\n";
37#endif /* not lint */
38
39#ifndef lint
40#if 0
41static char sccsid[] = "@(#)mount_null.c 8.6 (Berkeley) 4/26/95";
42#endif
43static const char rcsid[] =
44 "$FreeBSD: head/sbin/mount_nullfs/mount_nullfs.c 152670 2005-11-21 22:51:16Z rodrigc $";
44 "$FreeBSD: head/sbin/mount_nullfs/mount_nullfs.c 201227 2009-12-29 22:53:27Z ed $";
45#endif /* not lint */
46
47#include <sys/param.h>
48#include <sys/mount.h>
49#include <sys/uio.h>
50
51#include <err.h>
52#include <stdio.h>

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

111 iov[5].iov_len = strlen(target) + 1;
112
113 if (nmount(iov, 6, mntflags))
114 err(1, NULL);
115 exit(0);
116}
117
118int
45#endif /* not lint */
46
47#include <sys/param.h>
48#include <sys/mount.h>
49#include <sys/uio.h>
50
51#include <err.h>
52#include <stdio.h>

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

111 iov[5].iov_len = strlen(target) + 1;
112
113 if (nmount(iov, 6, mntflags))
114 err(1, NULL);
115 exit(0);
116}
117
118int
119subdir(p, dir)
120 const char *p;
121 const char *dir;
119subdir(const char *p, const char *dir)
122{
123 int l;
124
125 l = strlen(dir);
126 if (l <= 1)
127 return (1);
128
129 if ((strncmp(p, dir, l) == 0) && (p[l] == '/' || p[l] == '\0'))
130 return (1);
131
132 return (0);
133}
134
135static void
120{
121 int l;
122
123 l = strlen(dir);
124 if (l <= 1)
125 return (1);
126
127 if ((strncmp(p, dir, l) == 0) && (p[l] == '/' || p[l] == '\0'))
128 return (1);
129
130 return (0);
131}
132
133static void
136usage()
134usage(void)
137{
138 (void)fprintf(stderr,
139 "usage: mount_nullfs [-o options] target mount-point\n");
140 exit(1);
141}
135{
136 (void)fprintf(stderr,
137 "usage: mount_nullfs [-o options] target mount-point\n");
138 exit(1);
139}