summaryrefslogtreecommitdiffstats
path: root/pcilib/pci.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-08-05 19:13:07 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-08-05 19:13:07 +0200
commit6ac0cf129270aef989785e3fbc84abc238a29e92 (patch)
treee24b43e3ace522a1a4db5cfa40da7246aee21041 /pcilib/pci.c
parent7c5897933f4f64594602b2e38264af705c061754 (diff)
downloadpcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.tar.gz
pcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.tar.bz2
pcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.tar.xz
pcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.zip
Read model from environmental variable if defined
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r--pcilib/pci.c3
1 files changed, 3 insertions, 0 deletions
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;