mount_std.c (101270) | mount_std.c (102231) |
---|---|
1/* 2 * Copyright (c) 1990, 1992 Jan-Simon Pendry 3 * Copyright (c) 1992, 1993, 1994 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 29 unchanged lines hidden (view full) --- 38#ifndef lint 39static const char copyright[] = 40"@(#) Copyright (c) 1992, 1993, 1994\n\ 41 The Regents of the University of California. All rights reserved.\n"; 42#endif /* not lint */ 43 44#ifndef lint 45static const char rcsid[] = | 1/* 2 * Copyright (c) 1990, 1992 Jan-Simon Pendry 3 * Copyright (c) 1992, 1993, 1994 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 29 unchanged lines hidden (view full) --- 38#ifndef lint 39static const char copyright[] = 40"@(#) Copyright (c) 1992, 1993, 1994\n\ 41 The Regents of the University of California. All rights reserved.\n"; 42#endif /* not lint */ 43 44#ifndef lint 45static const char rcsid[] = |
46 "$FreeBSD: head/sbin/mount_std/mount_std.c 101270 2002-08-03 16:03:21Z mux $"; | 46 "$FreeBSD: head/sbin/mount_std/mount_std.c 102231 2002-08-21 18:11:48Z trhodes $"; |
47#endif /* not lint */ 48 49#include <sys/param.h> 50#include <sys/mount.h> 51#include <sys/uio.h> 52 53#include <err.h> 54#include <errno.h> --- 30 unchanged lines hidden (view full) --- 85 int ch, mntflags; 86 char mntpath[MAXPATHLEN]; 87 struct iovec iov[4]; 88 int error; 89 90 /* 91 * XXX 92 * mount(8) calls the mount programs with an argv[0] which is | 47#endif /* not lint */ 48 49#include <sys/param.h> 50#include <sys/mount.h> 51#include <sys/uio.h> 52 53#include <err.h> 54#include <errno.h> --- 30 unchanged lines hidden (view full) --- 85 int ch, mntflags; 86 char mntpath[MAXPATHLEN]; 87 struct iovec iov[4]; 88 int error; 89 90 /* 91 * XXX 92 * mount(8) calls the mount programs with an argv[0] which is |
93 * /just/ the filesystem name. So, if there is no underscore | 93 * /just/ the file system name. So, if there is no underscore |
94 * in argv[0], we assume that we are being called from mount(8) | 94 * in argv[0], we assume that we are being called from mount(8) |
95 * and that argv[0] is thus the name of the filesystem type. | 95 * and that argv[0] is thus the name of the file system type. |
96 */ 97 fsname = strrchr(argv[0], '_'); 98 if (fsname) { 99 if (strcmp(fsname, "_std") == 0) 100 errx(EX_USAGE, "argv[0] must end in _fsname"); 101 fsname++; 102 } else { 103 fsname = argv[0]; --- 37 unchanged lines hidden (view full) --- 141 * FreeBSD-5.0. 142 */ 143 signal(SIGSYS, catchsig); 144 error = nmount(iov, 4, mntflags); 145 signal(SIGSYS, SIG_DFL); 146 147 /* 148 * Try with the old mount syscall in the case | 96 */ 97 fsname = strrchr(argv[0], '_'); 98 if (fsname) { 99 if (strcmp(fsname, "_std") == 0) 100 errx(EX_USAGE, "argv[0] must end in _fsname"); 101 fsname++; 102 } else { 103 fsname = argv[0]; --- 37 unchanged lines hidden (view full) --- 141 * FreeBSD-5.0. 142 */ 143 signal(SIGSYS, catchsig); 144 error = nmount(iov, 4, mntflags); 145 signal(SIGSYS, SIG_DFL); 146 147 /* 148 * Try with the old mount syscall in the case |
149 * this filesystem has not been converted yet, | 149 * this file system has not been converted yet, |
150 * or the user didn't recompile his kernel. 151 */ 152 if (error && (errno == EOPNOTSUPP || errno == ENOSYS || caughtsig)) 153 error = mount(fsname, mntpath, mntflags, NULL); 154 155 if (error) 156 err(EX_OSERR, NULL); 157 exit(0); 158} 159 160void 161usage() 162{ 163 (void)fprintf(stderr, 164 "usage: mount_%s [-o options] what_to_mount mount_point\n", 165 fsname); 166 exit(EX_USAGE); 167} | 150 * or the user didn't recompile his kernel. 151 */ 152 if (error && (errno == EOPNOTSUPP || errno == ENOSYS || caughtsig)) 153 error = mount(fsname, mntpath, mntflags, NULL); 154 155 if (error) 156 err(EX_OSERR, NULL); 157 exit(0); 158} 159 160void 161usage() 162{ 163 (void)fprintf(stderr, 164 "usage: mount_%s [-o options] what_to_mount mount_point\n", 165 fsname); 166 exit(EX_USAGE); 167} |