summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1997-02-17 13:31:52 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1997-02-17 13:31:52 +0000
commitef6315440d28c7067c8d3ca516ef0fa9bb23d12e (patch)
tree4f1544c02273b41c32eff1b8c6ed6123df335d96
parent257b64e655ec81f6fd3c6ab1805a37ba03ec1fea (diff)
Notes
-rw-r--r--release/sysinstall/install.c12
-rw-r--r--release/sysinstall/media.c31
-rw-r--r--release/sysinstall/sysinstall.h4
-rw-r--r--release/sysinstall/tcpip.c30
4 files changed, 39 insertions, 38 deletions
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index bee4800d6965..d86f6cd60ef4 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.71.2.116 1997/02/16 06:48:59 jkh Exp $
+ * $Id: install.c,v 1.71.2.117 1997/02/16 23:36:13 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -499,12 +499,12 @@ installNovice(dialogMenuItem *self)
}
if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) {
if (!msgYesNo("Would you like to configure any SLIP/PPP or network interface devices?")) {
- Device *save = mediaDevice;
+ Device *tmp;
- /* This will also set the media device, which we don't want */
- tcpDeviceSelect();
- /* so we restore our saved value below */
- mediaDevice = save;
+ tmp = tcpDeviceSelect();
+ if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
+ if (!tmp->init(tmp))
+ msgConfirm("Initialization of %s device failed.", tmp->name);
dialog_clear_norefresh();
}
}
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c
index cc8bd2172be2..6ed7c539c454 100644
--- a/release/sysinstall/media.c
+++ b/release/sysinstall/media.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: media.c,v 1.25.2.45 1997/02/07 04:26:26 jkh Exp $
+ * $Id: media.c,v 1.25.2.46 1997/02/14 21:29:23 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -335,18 +335,16 @@ mediaSetFTP(dialogMenuItem *self)
"would you like to skip over it now?") != 0) {
if (networkDev)
networkDev->shutdown(networkDev);
- networkDev = NULL;
- if (!tcpDeviceSelect()) {
+ if (!(networkDev = tcpDeviceSelect())) {
variable_unset(VAR_FTP_PATH);
return DITEM_FAILURE | what;
}
- if (!mediaDevice || !mediaDevice->init(mediaDevice)) {
- if (isDebug())
- msgDebug("mediaSetFTP: Net device init failed.\n");
- variable_unset(VAR_FTP_PATH);
- return DITEM_FAILURE | what;
- }
- networkDev = mediaDevice;
+ }
+ if (!networkDev->init(networkDev)) {
+ if (isDebug())
+ msgDebug("mediaSetFTP: Net device init failed.\n");
+ variable_unset(VAR_FTP_PATH);
+ return DITEM_FAILURE | what;
}
hostname = cp + 6;
if ((cp = index(hostname, ':')) != NULL) {
@@ -448,15 +446,12 @@ mediaSetNFS(dialogMenuItem *self)
"would you like to skip over it now?") != 0) {
if (networkDev)
networkDev->shutdown(networkDev);
- networkDev = NULL;
- if (!tcpDeviceSelect())
- return DITEM_FAILURE;
- if (!mediaDevice || !mediaDevice->init(mediaDevice)) {
- if (isDebug())
- msgDebug("mediaSetNFS: Net device init failed\n");
+ if (!(networkDev = tcpDeviceSelect()))
return DITEM_FAILURE;
- }
- networkDev = mediaDevice;
+ }
+ if (!networkDev->init(networkDev)) {
+ if (isDebug())
+ msgDebug("mediaSetNFS: Net device init failed\n");
}
if (variable_get(VAR_NAMESERVER)) {
if ((gethostbyname(cp) == NULL) && (inet_addr(cp) == INADDR_NONE)) {
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index f2e7cce311dd..2c61bdc59df6 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.42.2.75 1997/02/15 13:20:12 jkh Exp $
+ * $Id: sysinstall.h,v 1.42.2.76 1997/02/15 15:41:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -666,7 +666,7 @@ extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
extern int tcpMenuSelect(dialogMenuItem *self);
-extern Boolean tcpDeviceSelect(void);
+extern Device *tcpDeviceSelect(void);
/* termcap.c */
extern int set_termcap(void);
diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c
index ffb45fb25965..6f1437dd7e9b 100644
--- a/release/sysinstall/tcpip.c
+++ b/release/sysinstall/tcpip.c
@@ -1,5 +1,5 @@
/*
- * $Id: tcpip.c,v 1.30.2.31 1997/02/13 00:33:00 jkh Exp $
+ * $Id: tcpip.c,v 1.30.2.32 1997/02/14 21:29:27 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@@ -309,6 +309,8 @@ reenter:
return ret;
}
+static Device *NetDev;
+
static int
netHook(dialogMenuItem *self)
{
@@ -317,33 +319,31 @@ netHook(dialogMenuItem *self)
devs = deviceFindDescr(self->prompt, self->title, DEVICE_TYPE_NETWORK);
if (devs) {
if (DITEM_STATUS(tcpOpenDialog(devs[0])) != DITEM_FAILURE)
- mediaDevice = devs[0];
+ NetDev = devs[0];
else
- devs = NULL;
+ NetDev = NULL;
}
return devs ? DITEM_LEAVE_MENU : DITEM_FAILURE;
}
/* Get a network device */
-Boolean
+Device *
tcpDeviceSelect(void)
{
DMenu *menu;
- Device **devs;
+ Device **devs, *rval;
int cnt;
- int status;
devs = deviceFind(NULL, DEVICE_TYPE_NETWORK);
cnt = deviceCount(devs);
if (!cnt) {
msgConfirm("No network devices available!");
- status = FALSE;
+ rval = NULL;
}
else if (cnt == 1) {
if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_FAILURE))
- return FALSE;
- mediaDevice = devs[0];
- status = TRUE;
+ return NULL;
+ rval = devs[0];
}
else {
menu = deviceCreateMenu(&MenuNetworkDevice, DEVICE_TYPE_NETWORK, netHook, NULL);
@@ -351,14 +351,20 @@ tcpDeviceSelect(void)
msgFatal("Unable to create network device menu! Argh!");
status = dmenuOpenSimple(menu, FALSE);
free(menu);
+ rval = NetDev;
}
- return status;
+ return rval;
}
/* Do it from a menu that doesn't care about status */
int
tcpMenuSelect(dialogMenuItem *self)
{
- (void)tcpDeviceSelect();
+ Device *tmp;
+
+ tmp = tcpDeviceSelect();
+ if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
+ if (!tmp->init(tmp))
+ msgConfirm("Initialization of %s device failed.", tmp->name);
return DITEM_SUCCESS | DITEM_RESTORE;
}