Deleted Added
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

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

68int
69main(argc, argv)
70 int argc;
71 char *argv[];
72{
73 struct union_args args;
74 int ch, mntflags;
75 char target[MAXPATHLEN];
76 struct vfsconf *vfc;
77
78 mntflags = 0;
79 args.mntflags = UNMNT_ABOVE;
80 while ((ch = getopt(argc, argv, "bo:r")) != EOF)
81 switch (ch) {
82 case 'b':
83 args.mntflags &= ~UNMNT_OPMASK;
84 args.mntflags |= UNMNT_BELOW;

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

105 err(1, "%s", target);
106
107 if (subdir(target, argv[1]) || subdir(argv[1], target))
108 errx(1, "%s (%s) and %s are not distinct paths",
109 argv[0], target, argv[1]);
110
111 args.target = target;
112
112 if (mount(MOUNT_UNION, argv[1], mntflags, &args))
113 vfc = getvfsbyname("union");
114 if(!vfc && vfsisloadable("union")) {
115 if(vfsload("union"))
116 err(1, "vfsload(union)");
117 endvfsent(); /* flush cache */
118 vfc = getvfsbyname("union");
119 }
120
121 if (mount(vfc ? vfc->vfc_index : MOUNT_UNION, argv[1], mntflags, &args))
122 err(1, NULL);
123 exit(0);
124}
125
126int
127subdir(p, dir)
128 const char *p;
129 const char *dir;

--- 20 unchanged lines hidden ---