diff options
author | jkh <jkh@FreeBSD.org> | 1998-02-10 18:43:11 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-02-10 18:43:11 +0000 |
commit | c852558573b47067fef500b0cdd3e3de30f1160a (patch) | |
tree | 2dac8e0b33106829d8c3e86608bc299b097c0ce1 | |
parent | 7ef8a69bf63493cd9d6842c0494f0fe4b5dbccbb (diff) | |
download | FreeBSD-src-c852558573b47067fef500b0cdd3e3de30f1160a.zip FreeBSD-src-c852558573b47067fef500b0cdd3e3de30f1160a.tar.gz |
Form device names correctly with new unit# syntax.
-rw-r--r-- | release/sysinstall/devices.c | 17 | ||||
-rw-r--r-- | usr.sbin/sade/devices.c | 17 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 17 |
3 files changed, 39 insertions, 12 deletions
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c index aebfe66..80740a1 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.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); diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index aebfe66..80740a1 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.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); 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); |