summaryrefslogtreecommitdiffstats
path: root/release/sysinstall/attr.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-12-11 09:35:06 +0000
committerjkh <jkh@FreeBSD.org>1996-12-11 09:35:06 +0000
commit3727883bddbc2a8ead72a97011cf4763fe5c7ede (patch)
tree3e96d1a8c70e76ad8e35ec46e4c61b3f0ab3295c /release/sysinstall/attr.c
parent90d182874d165b16fcb0758a86668941f1ddda01 (diff)
downloadFreeBSD-src-3727883bddbc2a8ead72a97011cf4763fe5c7ede.zip
FreeBSD-src-3727883bddbc2a8ead72a97011cf4763fe5c7ede.tar.gz
Do a few things I've been threatening to do for a long time:
1. Don't use the MSDOSFS code for accessing FreeBSD distribution data. Use Robert Nordier's stand-alone DOS I/O library for the purpose. It this works as well as Robert says it does, it should drastically reduce (or even eliminate) our "I can't install from my DOS partition!" calls. 2. As a result of the above, go to stdio file descriptors for all media types. 3. Taking advantage of #2, start using libftpio for FTP transfers instead of maintaining our own parallel version of the FTP transfer code. Yay! I ripped something out for a change! #1 Submitted-By: Robert Nordier <rnordier@iafrica.com>
Diffstat (limited to 'release/sysinstall/attr.c')
-rw-r--r--release/sysinstall/attr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/release/sysinstall/attr.c b/release/sysinstall/attr.c
index 0bd06cf..7b2df73 100644
--- a/release/sysinstall/attr.c
+++ b/release/sysinstall/attr.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: attr.c,v 1.8 1996/09/08 01:39:23 jkh Exp $
+ * $Id: attr.c,v 1.9 1996/12/09 08:22:10 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -38,25 +38,25 @@
#include "sysinstall.h"
#include <ctype.h>
-#include <fcntl.h>
#include <sys/errno.h>
int
attr_parse_file(Attribs *attr, char *file)
{
- int fd, status;
+ int status;
+ FILE *fp;
- if ((fd = open(file, O_RDONLY)) == -1) {
+ if ((fp = fopen(file, "r")) == NULL) {
msgConfirm("Cannot open the information file `%s': %s (%d)", file, strerror(errno), errno);
return DITEM_FAILURE;
}
- status = attr_parse(attr, fd);
- close(fd);
+ status = attr_parse(attr, fp);
+ fclose(fp);
return status;
}
int
-attr_parse(Attribs *attr, int fd)
+attr_parse(Attribs *attr, FILE *fp)
{
char hold_n[MAX_NAME+1];
char hold_v[MAX_VALUE+1];
@@ -67,7 +67,7 @@ attr_parse(Attribs *attr, int fd)
n = v = lno = num_attribs = 0;
state = LOOK;
- while (state == COMMIT || (read(fd, &ch, 1) == 1)) {
+ while (state == COMMIT || (fread(&ch, 1, 1, fp) == 1)) {
/* Count lines */
if (ch == '\n')
++lno;
@@ -116,7 +116,7 @@ attr_parse(Attribs *attr, int fd)
continue;
else if (ch == '{') {
/* multiline value */
- while (read(fd, &ch, 1) == 1 && ch != '}') {
+ while (fread(&ch, 1, 1, fp) == 1 && ch != '}') {
if (v == MAX_VALUE)
msgFatal("Value length overflow at line %d", lno);
hold_v[v++] = ch;
OpenPOWER on IntegriCloud