From 95742f4173ec5946e4135b50599f3f61525cd707 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Mon, 16 Mar 1998 14:33:18 +0000 Subject: [PATCH] 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. --- release/sysinstall/devices.c | 7 +++++-- usr.sbin/sade/devices.c | 7 +++++-- usr.sbin/sysinstall/devices.c | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c index 5837ba92e765..fbd5c5606489 100644 --- a/release/sysinstall/devices.c +++ b/release/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 @@ deviceGetAll(void) 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/sade/devices.c b/usr.sbin/sade/devices.c index 5837ba92e765..fbd5c5606489 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 @@ deviceGetAll(void) 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 5837ba92e765..fbd5c5606489 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 @@ deviceGetAll(void) 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];