aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/cdrom.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1995-05-27 23:39:35 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1995-05-27 23:39:35 +0000
commit25fce75ee4645adadc441c4c64a0f6de0158e683 (patch)
tree291cad597f17930adf43e6eedc0bc0f9042e1b66 /usr.sbin/sysinstall/cdrom.c
parentbb628eaac63fd9214f2ec49f893abcff2da1a0ec (diff)
downloadsrc-25fce75ee4645adadc441c4c64a0f6de0158e683.tar.gz
src-25fce75ee4645adadc441c4c64a0f6de0158e683.zip
Major cleanup. Mediaroutines now get asked about a file. All the
multi part stuff centralized. The final check is backwards or something so it always said it failed, even it it didn't. Fixed tcpip address check to not be stupid, 10.0.255.1 is legal.
Notes
Notes: svn path=/head/; revision=8799
Diffstat (limited to 'usr.sbin/sysinstall/cdrom.c')
-rw-r--r--usr.sbin/sysinstall/cdrom.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c
index 3152bf0fd4a7..095cc19c2d6e 100644
--- a/usr.sbin/sysinstall/cdrom.c
+++ b/usr.sbin/sysinstall/cdrom.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_strategy.c,v 1.28 1995/05/26 20:30:59 jkh Exp $
+ * $Id: cdrom.c,v 1.1 1995/05/27 10:38:45 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -57,6 +57,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include <grp.h>
+#include <fcntl.h>
#define CD9660
#include <sys/mount.h>
@@ -102,45 +103,19 @@ mediaInitCDROM(Device *dev)
}
int
-mediaGetCDROM(char *dist, char *path)
+mediaGetCDROM(char *file)
{
char buf[PATH_MAX];
- Attribs *dist_attr;
- int retval;
- dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS);
-
- snprintf(buf, PATH_MAX, "/stand/info/%s.inf", dist);
-
- if (!access(buf, R_OK) && attr_parse(&dist_attr, buf) == 0) {
- msgConfirm("Cannot load information file for %s distribution!\nPlease verify that your media is valid and try again.", dist);
- free(dist_attr);
- return FALSE;
- }
-
- snprintf(buf, PATH_MAX, "/cdrom/%s%s", path ? path : "", dist);
- retval = genericGetDist(buf, dist_attr, FALSE);
- free(dist_attr);
- return retval;
+ snprintf(buf, PATH_MAX, "/cdrom/%s", file);
+ return open(buf,O_RDONLY);
}
void
mediaShutdownCDROM(Device *dev)
{
- extern int getDistpid;
-
if (!cdromMounted)
return;
- if (getDistpid) {
- int i, j;
-
- i = waitpid(getDistpid, &j, 0);
- if (i < 0 || WEXITSTATUS(j)) {
- msgConfirm("Warning: Last extraction returned status code %d.", WEXITSTATUS(j));
- getDistpid = 0;
- }
- getDistpid = 0;
- }
msgDebug("Unmounting /cdrom\n");
if (unmount("/cdrom", 0) != 0)
msgConfirm("Could not unmount the CDROM: %s\n", strerror(errno));