summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorweongyo <weongyo@FreeBSD.org>2008-06-18 06:35:37 +0000
committerweongyo <weongyo@FreeBSD.org>2008-06-18 06:35:37 +0000
commitefe54e593f51a0aea33466031a0181c9c28da6a1 (patch)
tree5213c24a3c69ec8e15d41d72ac06490d4774338b /usr.sbin
parentb12551bbfa1c146748eb1514a8d44d48b1c74d92 (diff)
downloadFreeBSD-src-efe54e593f51a0aea33466031a0181c9c28da6a1.zip
FreeBSD-src-efe54e593f51a0aea33466031a0181c9c28da6a1.tar.gz
handle .INF files for PCMCIA correctly that specify multiple entries in
their [Manufacturer] sections and prevent a case that NDIS_PCI_DEV_TABLE definition was always emitted that it's only emitted once if a .INF file is for PCI.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ndiscvt/inf.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/ndiscvt/inf.c b/usr.sbin/ndiscvt/inf.c
index ef1892f..05f863d 100644
--- a/usr.sbin/ndiscvt/inf.c
+++ b/usr.sbin/ndiscvt/inf.c
@@ -258,10 +258,7 @@ dump_deviceids_pci()
struct section *sec;
struct assign *assign;
char xpsec[256];
- int found = 0;
-
- /* Emit start of PCI device table */
- fprintf (ofp, "#define NDIS_PCI_DEV_TABLE");
+ int first = 1, found = 0;
/* Find manufacturer name */
manf = find_assign("Manufacturer", NULL);
@@ -298,6 +295,12 @@ nextmanf:
found = 0;
+ if (first == 1) {
+ /* Emit start of PCI device table */
+ fprintf (ofp, "#define NDIS_PCI_DEV_TABLE");
+ first = 0;
+ }
+
retry:
/*
@@ -348,7 +351,7 @@ dump_deviceids_pcmcia()
struct section *sec;
struct assign *assign;
char xpsec[256];
- int found = 0;
+ int first = 1, found = 0;
/* Find manufacturer name */
manf = find_assign("Manufacturer", NULL);
@@ -385,8 +388,11 @@ nextmanf:
found = 0;
- /* Emit start of PCMCIA device table */
- fprintf (ofp, "#define NDIS_PCMCIA_DEV_TABLE");
+ if (first == 1) {
+ /* Emit start of PCMCIA device table */
+ fprintf (ofp, "#define NDIS_PCMCIA_DEV_TABLE");
+ first = 0;
+ }
retry:
OpenPOWER on IntegriCloud