diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1994-05-26 13:24:02 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1994-05-26 13:24:02 +0000 |
commit | c8f1a26f8dda7f5350f6d52f5bbc4f5ec1a46cc4 (patch) | |
tree | 091be2a230c62c316ca02cf1016e73b206c14d25 /usr.sbin/config/mkswapconf.c | |
parent | 28839c379536620b072ba59884f5eed06d72e94d (diff) | |
download | FreeBSD-src-c8f1a26f8dda7f5350f6d52f5bbc4f5ec1a46cc4.zip FreeBSD-src-c8f1a26f8dda7f5350f6d52f5bbc4f5ec1a46cc4.tar.gz |
Upgrade config to be compatible with our i386 port, pull in 95% of the
changes that have been made in FreeBSD 1.x, except for possibly the nfs
diskless support this is a completed config.
Diffstat (limited to 'usr.sbin/config/mkswapconf.c')
-rw-r--r-- | usr.sbin/config/mkswapconf.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/usr.sbin/config/mkswapconf.c b/usr.sbin/config/mkswapconf.c index e499973..3cbef69 100644 --- a/usr.sbin/config/mkswapconf.c +++ b/usr.sbin/config/mkswapconf.c @@ -193,6 +193,7 @@ devtoname(dev) initdevtable() { + char linebuf[256]; char buf[BUFSIZ]; int maj; register struct devdescription **dp = &devtable; @@ -204,11 +205,21 @@ initdevtable() fprintf(stderr, "config: can't open %s\n", buf); exit(1); } - while (fscanf(fp, "%s\t%d\n", buf, &maj) == 2) { - *dp = (struct devdescription *)malloc(sizeof (**dp)); - (*dp)->dev_name = ns(buf); - (*dp)->dev_major = maj; - dp = &(*dp)->dev_next; + while(fgets(linebuf,256,fp)) { + /*******************************\ + * Allow a comment * + \*******************************/ + if(linebuf[0] == '#') continue; + + if (sscanf(linebuf, "%s\t%d\n", buf, &maj) == 2) { + *dp = (struct devdescription *)malloc(sizeof (**dp)); + (*dp)->dev_name = ns(buf); + (*dp)->dev_major = maj; + dp = &(*dp)->dev_next; + } else { + fprintf(stderr,"illegal line in devices file\n"); + break; + } } *dp = 0; fclose(fp); |