dump_init(struct pci_access *a)
{
char *name = pci_get_param(a, "dump.name");
- FILE *f;
+ const char *err;
if (!name)
a->error("dump: File name not given.");
- if (!(f = fopen(name, "r")))
- a->error("dump: Cannot open %s: %s", name, strerror(errno));
- const char *err = dump_parse(a, f);
-
- fclose(f);
+ if (!strcmp(name, "-"))
+ err = dump_parse(a, stdin);
+ else
+ {
+ FILE *f = fopen(name, "r");
+ if (!f)
+ a->error("dump: Cannot open %s: %s", name, strerror(errno));
+ err = dump_parse(a, f);
+ fclose(f);
+ }
if (err)
a->error("dump: %s", err);
.B -F <file>
Instead of accessing real hardware, read the list of devices and values of their
configuration registers from the given file produced by an earlier run of lspci -x.
+If
+.I file
+is a single dash (\fB-\fP), read the contents from stdin.
+.IP
This is very useful for analysis of user-supplied bug reports, because you can display
the hardware configuration in any way you want without disturbing the user with
requests for more dumps.