From 6ac0cf129270aef989785e3fbc84abc238a29e92 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 5 Aug 2015 19:13:07 +0200 Subject: Read model from environmental variable if defined --- pcilib/pci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pcilib/pci.c') diff --git a/pcilib/pci.c b/pcilib/pci.c index 512e891..6078a6e 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -108,6 +108,9 @@ pcilib_t *pcilib_open(const char *device, const char *model) { size_t i; pcilib_t *ctx = malloc(sizeof(pcilib_t)); + if (!model) + model = getenv("PCILIB_MODEL"); + if (ctx) { memset(ctx, 0, sizeof(pcilib_t)); ctx->pci_cfg_space_fd = -1; -- cgit v1.2.3