-/* $OpenBSD: fsck.c,v 1.2 1996/12/04 01:31:11 deraadt Exp $ */
+/* $OpenBSD: fsck.c,v 1.3 1996/12/04 09:40:41 deraadt Exp $ */
/* $NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $ */
/*
const char **argv, **edir;
pid_t pid;
int argc, i, status, maxargc;
- char *optbuf = NULL, execname[MAXPATHLEN + 1];
+ char *optbuf = NULL, fsname[MAXPATHLEN], execname[MAXPATHLEN];
const char *extra = getoptions(vfstype);
-#ifdef __GNUC__
- /* Avoid vfork clobbering */
- (void) &optbuf;
-#endif
-
if (strcmp(vfstype, "ufs") == 0)
vfstype = MOUNT_UFS;
argv = emalloc(sizeof(char *) * maxargc);
argc = 0;
- argv[argc++] = vfstype;
+ (void)snprintf(fsname, sizeof(fsname), "fsck_%s", vfstype);
+ argv[argc++] = fsname;
if (options) {
if (extra != NULL)
argv[argc] = NULL;
if (flags & (CHECK_DEBUG|CHECK_VERBOSE)) {
- (void)printf("start %s %swait fsck_%s", mntpt,
- pidp ? "no" : "", vfstype);
+ (void)printf("start %s %swait %s", mntpt,
+ pidp ? "no" : "", fsname);
for (i = 1; i < argc; i++)
(void)printf(" %s", argv[i]);
(void)printf("\n");
}
- switch (pid = vfork()) {
+ switch (pid = fork()) {
case -1: /* Error. */
warn("vfork");
if (optbuf)
-/* $OpenBSD: mount.c,v 1.7 1996/12/03 01:04:44 downsj Exp $ */
+/* $OpenBSD: mount.c,v 1.8 1996/12/04 09:45:39 deraadt Exp $ */
/* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)mount.c 8.19 (Berkeley) 4/19/94";
#else
-static char rcsid[] = "$OpenBSD: mount.c,v 1.7 1996/12/03 01:04:44 downsj Exp $";
+static char rcsid[] = "$OpenBSD: mount.c,v 1.8 1996/12/04 09:45:39 deraadt Exp $";
#endif
#endif /* not lint */
struct statfs sf;
pid_t pid;
int argc, i, status;
- char *optbuf, execname[MAXPATHLEN + 1], mntpath[MAXPATHLEN];
+ char *optbuf, execname[MAXPATHLEN], mntpath[MAXPATHLEN];
char mountname[MAXPATHLEN];
if (realpath(name, mntpath) == NULL) {
if (flags & MNT_UPDATE)
optbuf = catopt(optbuf, "update");
+ (void)snprintf(mountname,
+ sizeof(mountname), "mount_%s", vfstype);
+
argc = 0;
- argv[argc++] = vfstype;
+ argv[argc++] = mountname;
mangle(optbuf, &argc, argv);
argv[argc++] = spec;
argv[argc++] = name;
return (0);
}
- switch (pid = vfork()) {
+ switch (pid = fork()) {
case -1: /* Error. */
- warn("vfork");
+ warn("fork");
free(optbuf);
return (1);
case 0: /* Child. */
do {
(void)snprintf(execname,
sizeof(execname), "%s/mount_%s", *edir, vfstype);
- (void)snprintf(mountname,
- sizeof(mountname), "mount_%s", vfstype);
- argv[0] = mountname;
execv(execname, (char * const *)argv);
if (errno != ENOENT)
warn("exec %s for %s", execname, name);