Bring my changes forward from 2.1

This commit is contained in:
Jordan K. Hubbard 1995-12-11 16:32:33 +00:00
parent cb6962cdee
commit 3eaa341f6a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12781
9 changed files with 36 additions and 48 deletions

View file

@ -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.36.2.11 1995/11/15 06:57:02 jkh Exp $
* $Id: devices.c,v 1.37 1995/12/07 10:33:38 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -47,6 +47,7 @@
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <net/if.h>
#include <net/if_dl.h>
@ -166,6 +167,8 @@ deviceTry(char *name, char *try)
fd = open(try, O_RDWR);
if (fd > 0)
return fd;
else if (errno == EACCES)
return 0;
snprintf(try, FILENAME_MAX, "/mnt/dev/%s", name);
fd = open(try, O_RDWR);
return fd;
@ -251,7 +254,7 @@ deviceGetAll(void)
case DEVICE_TYPE_CDROM:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
(void)deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_CDROM, TRUE, mediaInitCDROM, mediaGetCDROM, NULL,
mediaShutdownCDROM, NULL);
@ -262,7 +265,7 @@ deviceGetAll(void)
case DEVICE_TYPE_TAPE:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_TAPE, TRUE, mediaInitTape, mediaGetTape, NULL, mediaShutdownTape, NULL);
msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name);
@ -272,7 +275,7 @@ deviceGetAll(void)
case DEVICE_TYPE_FLOPPY:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy, NULL,
mediaShutdownFloppy, NULL);
@ -283,7 +286,7 @@ deviceGetAll(void)
case DEVICE_TYPE_NETWORK:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
/* The only network devices that have fds associated are serial ones */
deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_NETWORK,
TRUE, mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.32 1995/09/18 16:52:23 peter Exp $
* $Id: disks.c,v 1.33 1995/12/07 10:33:39 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -520,10 +520,6 @@ partitionHook(char *str)
msgConfirm("Unable to find disk %s!", str);
return 0;
}
else if (devs[1]) {
dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
}
devs[0]->enabled = TRUE;
diskPartition(devs[0], (Disk *)devs[0]->private);
str = cp;

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.33 1995/09/18 16:52:28 peter Exp $
* $Id: label.c,v 1.34 1995/12/07 10:33:54 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -108,10 +108,6 @@ labelHook(char *str)
msgConfirm("Unable to find disk %s!", str);
return 0;
}
else if (devs[1]) {
dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
}
devs[0]->enabled = TRUE;
str = cp;
}
@ -137,7 +133,8 @@ diskLabelEditor(char *str)
return RET_FAIL;
}
else if (cnt == 1 || variable_get(DISK_SELECTED)) {
devs[0]->enabled = TRUE;
if (cnt == 1)
devs[0]->enabled = TRUE;
if (str && !strcmp(str, "script"))
i = scriptLabel(str);
else

View file

@ -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.36.2.11 1995/11/15 06:57:02 jkh Exp $
* $Id: devices.c,v 1.37 1995/12/07 10:33:38 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -47,6 +47,7 @@
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <net/if.h>
#include <net/if_dl.h>
@ -166,6 +167,8 @@ deviceTry(char *name, char *try)
fd = open(try, O_RDWR);
if (fd > 0)
return fd;
else if (errno == EACCES)
return 0;
snprintf(try, FILENAME_MAX, "/mnt/dev/%s", name);
fd = open(try, O_RDWR);
return fd;
@ -251,7 +254,7 @@ deviceGetAll(void)
case DEVICE_TYPE_CDROM:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
(void)deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_CDROM, TRUE, mediaInitCDROM, mediaGetCDROM, NULL,
mediaShutdownCDROM, NULL);
@ -262,7 +265,7 @@ deviceGetAll(void)
case DEVICE_TYPE_TAPE:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_TAPE, TRUE, mediaInitTape, mediaGetTape, NULL, mediaShutdownTape, NULL);
msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name);
@ -272,7 +275,7 @@ deviceGetAll(void)
case DEVICE_TYPE_FLOPPY:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy, NULL,
mediaShutdownFloppy, NULL);
@ -283,7 +286,7 @@ deviceGetAll(void)
case DEVICE_TYPE_NETWORK:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
/* The only network devices that have fds associated are serial ones */
deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_NETWORK,
TRUE, mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.32 1995/09/18 16:52:23 peter Exp $
* $Id: disks.c,v 1.33 1995/12/07 10:33:39 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -520,10 +520,6 @@ partitionHook(char *str)
msgConfirm("Unable to find disk %s!", str);
return 0;
}
else if (devs[1]) {
dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
}
devs[0]->enabled = TRUE;
diskPartition(devs[0], (Disk *)devs[0]->private);
str = cp;

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.33 1995/09/18 16:52:28 peter Exp $
* $Id: label.c,v 1.34 1995/12/07 10:33:54 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -108,10 +108,6 @@ labelHook(char *str)
msgConfirm("Unable to find disk %s!", str);
return 0;
}
else if (devs[1]) {
dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
}
devs[0]->enabled = TRUE;
str = cp;
}
@ -137,7 +133,8 @@ diskLabelEditor(char *str)
return RET_FAIL;
}
else if (cnt == 1 || variable_get(DISK_SELECTED)) {
devs[0]->enabled = TRUE;
if (cnt == 1)
devs[0]->enabled = TRUE;
if (str && !strcmp(str, "script"))
i = scriptLabel(str);
else

View file

@ -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.36.2.11 1995/11/15 06:57:02 jkh Exp $
* $Id: devices.c,v 1.37 1995/12/07 10:33:38 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -47,6 +47,7 @@
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <net/if.h>
#include <net/if_dl.h>
@ -166,6 +167,8 @@ deviceTry(char *name, char *try)
fd = open(try, O_RDWR);
if (fd > 0)
return fd;
else if (errno == EACCES)
return 0;
snprintf(try, FILENAME_MAX, "/mnt/dev/%s", name);
fd = open(try, O_RDWR);
return fd;
@ -251,7 +254,7 @@ deviceGetAll(void)
case DEVICE_TYPE_CDROM:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
(void)deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_CDROM, TRUE, mediaInitCDROM, mediaGetCDROM, NULL,
mediaShutdownCDROM, NULL);
@ -262,7 +265,7 @@ deviceGetAll(void)
case DEVICE_TYPE_TAPE:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_TAPE, TRUE, mediaInitTape, mediaGetTape, NULL, mediaShutdownTape, NULL);
msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name);
@ -272,7 +275,7 @@ deviceGetAll(void)
case DEVICE_TYPE_FLOPPY:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
deviceRegister(device_names[i].name, device_names[i].description, strdup(try),
DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy, NULL,
mediaShutdownFloppy, NULL);
@ -283,7 +286,7 @@ deviceGetAll(void)
case DEVICE_TYPE_NETWORK:
fd = deviceTry(device_names[i].name, try);
if (fd >= 0) {
close(fd);
if (fd) close(fd);
/* The only network devices that have fds associated are serial ones */
deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_NETWORK,
TRUE, mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL);

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.32 1995/09/18 16:52:23 peter Exp $
* $Id: disks.c,v 1.33 1995/12/07 10:33:39 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -520,10 +520,6 @@ partitionHook(char *str)
msgConfirm("Unable to find disk %s!", str);
return 0;
}
else if (devs[1]) {
dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
}
devs[0]->enabled = TRUE;
diskPartition(devs[0], (Disk *)devs[0]->private);
str = cp;

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.33 1995/09/18 16:52:28 peter Exp $
* $Id: label.c,v 1.34 1995/12/07 10:33:54 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -108,10 +108,6 @@ labelHook(char *str)
msgConfirm("Unable to find disk %s!", str);
return 0;
}
else if (devs[1]) {
dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
}
devs[0]->enabled = TRUE;
str = cp;
}
@ -137,7 +133,8 @@ diskLabelEditor(char *str)
return RET_FAIL;
}
else if (cnt == 1 || variable_get(DISK_SELECTED)) {
devs[0]->enabled = TRUE;
if (cnt == 1)
devs[0]->enabled = TRUE;
if (str && !strcmp(str, "script"))
i = scriptLabel(str);
else