If the pci.ids file was empty, it was never considered loaded,
so the loading function was called repeatedly and it always flushed
the name cache.
const char *err;
pci_free_name_list(a);
- a->id_load_failed = 1;
+ a->id_load_attempted = 1;
if (!(f = pci_open(a)))
return 0;
err = id_parse_list(a, f, &lino);
pci_close(f);
if (err)
a->error("%s at %s, line %d\n", err, a->id_file_name, lino);
- a->id_load_failed = 0;
return 1;
}
pci_id_cache_flush(a);
pci_id_hash_free(a);
pci_id_hwdb_free(a);
- a->id_load_failed = 0;
+ a->id_load_attempted = 0;
}
void
if (flags & PCI_LOOKUP_MIXED)
flags &= ~PCI_LOOKUP_NUMERIC;
- if (!a->id_hash && !(flags & (PCI_LOOKUP_NUMERIC | PCI_LOOKUP_SKIP_LOCAL)) && !a->id_load_failed)
+ if (!a->id_load_attempted && !(flags & (PCI_LOOKUP_NUMERIC | PCI_LOOKUP_SKIP_LOCAL)))
pci_load_name_list(a);
switch (flags & 0xffff)
struct pci_param *params;
struct id_entry **id_hash; /* names.c */
struct id_bucket *current_id_bucket;
- int id_load_failed;
+ int id_load_attempted;
int id_cache_status; /* 0=not read, 1=read, 2=dirty */
struct udev *id_udev; /* names-hwdb.c */
struct udev_hwdb *id_udev_hwdb;