Deleted Added
full compact
mount_nullfs.c (1558) mount_nullfs.c (2999)
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

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

67int
68main(argc, argv)
69 int argc;
70 char *argv[];
71{
72 struct null_args args;
73 int ch, mntflags;
74 char target[MAXPATHLEN];
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

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

67int
68main(argc, argv)
69 int argc;
70 char *argv[];
71{
72 struct null_args args;
73 int ch, mntflags;
74 char target[MAXPATHLEN];
75 struct vfsconf *vfc;
75
76 mntflags = 0;
77 while ((ch = getopt(argc, argv, "o:")) != EOF)
78 switch(ch) {
79 case 'o':
80 getmntopts(optarg, mopts, &mntflags);
81 break;
82 case '?':

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

93 err(1, "%s", target);
94
95 if (subdir(target, argv[1]) || subdir(argv[1], target))
96 errx(1, "%s (%s) and %s are not distinct paths",
97 argv[0], target, argv[1]);
98
99 args.target = target;
100
76
77 mntflags = 0;
78 while ((ch = getopt(argc, argv, "o:")) != EOF)
79 switch(ch) {
80 case 'o':
81 getmntopts(optarg, mopts, &mntflags);
82 break;
83 case '?':

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

94 err(1, "%s", target);
95
96 if (subdir(target, argv[1]) || subdir(argv[1], target))
97 errx(1, "%s (%s) and %s are not distinct paths",
98 argv[0], target, argv[1]);
99
100 args.target = target;
101
101 if (mount(MOUNT_NULL, argv[1], mntflags, &args))
102 vfc = getvfsbyname("null");
103 if(!vfc && vfsisloadable("null")) {
104 if(vfsload("null"))
105 err(1, "vfsload(null)");
106 endvfsent(); /* flush cache */
107 vfc = getvfsbyname("null");
108 }
109
110 if (mount(vfc ? vfc->vfc_index : MOUNT_NULL, argv[1], mntflags, &args))
102 err(1, NULL);
103 exit(0);
104}
105
106int
107subdir(p, dir)
108 const char *p;
109 const char *dir;

--- 20 unchanged lines hidden ---
111 err(1, NULL);
112 exit(0);
113}
114
115int
116subdir(p, dir)
117 const char *p;
118 const char *dir;

--- 20 unchanged lines hidden ---