Deleted Added
sdiff udiff text old ( 152670 ) new ( 201227 )
full compact
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 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
119subdir(const char *p, const char *dir)
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
134usage(void)
135{
136 (void)fprintf(stderr,
137 "usage: mount_nullfs [-o options] target mount-point\n");
138 exit(1);
139}