diff options
author | jkh <jkh@FreeBSD.org> | 1998-03-16 14:33:18 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-03-16 14:33:18 +0000 |
commit | 97f546d2b8c0508c70ab749b9b0ca0f6f69e8f27 (patch) | |
tree | ee881d5541857b4c4762e89daf1917b438709766 /usr.sbin | |
parent | 2cd52de11c02a1a68aa5bc4d42b82b5a8ce998de (diff) | |
download | FreeBSD-src-97f546d2b8c0508c70ab749b9b0ca0f6f69e8f27.zip FreeBSD-src-97f546d2b8c0508c70ab749b9b0ca0f6f69e8f27.tar.gz |
1. If device node already exists, don't gratuituously try to make it
again.
2. Don't create slice entries when running multi-user; it adds far too
much to sysinstall's startup time. User is expected to have correct
slice entries after system is installed.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/devices.c | 7 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index 5837ba9..fbd5c56 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.70 1998/02/10 18:43:11 jkh Exp $ + * $Id: devices.c,v 1.71 1998/03/15 16:15:47 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -143,6 +143,9 @@ deviceTry(struct _devname dev, char *try, int i) snprintf(unit, sizeof unit, dev.name, i); snprintf(try, FILENAME_MAX, "/dev/%s", unit); + fd = open(try, O_RDONLY); + if (fd >= 0) + return fd; m = 0640; if (dev.dev_type == 'c') m |= S_IFCHR; @@ -296,7 +299,7 @@ skipif: case DEVICE_TYPE_DISK: fd = deviceTry(device_names[i], try, j); - if (fd >= 0) { + if (fd >= 0 && RunningAsInit) { dev_t d; int s, fail; char slice[80]; diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 5837ba9..fbd5c56 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.70 1998/02/10 18:43:11 jkh Exp $ + * $Id: devices.c,v 1.71 1998/03/15 16:15:47 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -143,6 +143,9 @@ deviceTry(struct _devname dev, char *try, int i) snprintf(unit, sizeof unit, dev.name, i); snprintf(try, FILENAME_MAX, "/dev/%s", unit); + fd = open(try, O_RDONLY); + if (fd >= 0) + return fd; m = 0640; if (dev.dev_type == 'c') m |= S_IFCHR; @@ -296,7 +299,7 @@ skipif: case DEVICE_TYPE_DISK: fd = deviceTry(device_names[i], try, j); - if (fd >= 0) { + if (fd >= 0 && RunningAsInit) { dev_t d; int s, fail; char slice[80]; |