summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-02-10 18:43:11 +0000
committerjkh <jkh@FreeBSD.org>1998-02-10 18:43:11 +0000
commitc852558573b47067fef500b0cdd3e3de30f1160a (patch)
tree2dac8e0b33106829d8c3e86608bc299b097c0ce1 /usr.sbin/sysinstall
parent7ef8a69bf63493cd9d6842c0494f0fe4b5dbccbb (diff)
downloadFreeBSD-src-c852558573b47067fef500b0cdd3e3de30f1160a.zip
FreeBSD-src-c852558573b47067fef500b0cdd3e3de30f1160a.tar.gz
Form device names correctly with new unit# syntax.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/devices.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c
index aebfe66..80740a1 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.68 1998/01/22 21:14:31 jkh Exp $
+ * $Id: devices.c,v 1.69 1998/02/10 18:31:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -267,8 +267,11 @@ skipif:
case DEVICE_TYPE_CDROM:
fd = deviceTry(device_names[i], try, j);
if (fd >= 0 || errno == EBUSY) { /* EBUSY if already mounted */
+ char n[BUFSIZ];
+
if (fd >= 0) close(fd);
- (void)deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
+ snprintf(n, sizeof n, device_names[i].name, j);
+ deviceRegister(strdup(n), device_names[i].description, strdup(try),
DEVICE_TYPE_CDROM, TRUE, mediaInitCDROM, mediaGetCDROM,
mediaShutdownCDROM, NULL);
msgDebug("Found a CDROM device for %s\n", try);
@@ -278,8 +281,11 @@ skipif:
case DEVICE_TYPE_TAPE:
fd = deviceTry(device_names[i], try, j);
if (fd >= 0) {
+ char n[BUFSIZ];
+
close(fd);
- deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
+ snprintf(n, sizeof n, device_names[i].name, j);
+ deviceRegister(strdup(n), device_names[i].description, strdup(try),
DEVICE_TYPE_TAPE, TRUE, mediaInitTape, mediaGetTape, mediaShutdownTape, NULL);
msgDebug("Found a TAPE device for %s\n", try);
}
@@ -296,8 +302,11 @@ skipif:
case DEVICE_TYPE_FLOPPY:
fd = deviceTry(device_names[i], try, j);
if (fd >= 0) {
+ char n[BUFSIZ];
+
close(fd);
- deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
+ snprintf(n, sizeof n, device_names[i].name, j);
+ deviceRegister(strdup(n), device_names[i].description, strdup(try),
DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy,
mediaShutdownFloppy, NULL);
msgDebug("Found a floppy device for %s\n", try);
OpenPOWER on IntegriCloud