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

--- 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];
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;
76
77 mntflags = 0;
78 args.mntflags = UNMNT_ABOVE;
79 while ((ch = getopt(argc, argv, "bo:r")) != EOF)
80 switch (ch) {
81 case 'b':
82 args.mntflags &= ~UNMNT_OPMASK;
83 args.mntflags |= UNMNT_BELOW;

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

104 err(1, "%s", target);
105
106 if (subdir(target, argv[1]) || subdir(argv[1], target))
107 errx(1, "%s (%s) and %s are not distinct paths",
108 argv[0], target, argv[1]);
109
110 args.target = target;
111
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))
113 err(1, NULL);
114 exit(0);
115}
116
117int
118subdir(p, dir)
119 const char *p;
120 const char *dir;

--- 20 unchanged lines hidden ---
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 ---