diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-03-03 00:50:59 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-03-03 00:50:59 +0100 |
commit | 195c28f3074486165b6e0935362810f8a1fb9531 (patch) | |
tree | 56aecf261aaae57e28c08cef573ae6642ec5394d /pcilib/pci.c | |
parent | 1e53d2d17e611586030e3ff3e9ab87e5bb753c9b (diff) | |
download | pcitool-195c28f3074486165b6e0935362810f8a1fb9531.tar.gz pcitool-195c28f3074486165b6e0935362810f8a1fb9531.tar.bz2 pcitool-195c28f3074486165b6e0935362810f8a1fb9531.tar.xz pcitool-195c28f3074486165b6e0935362810f8a1fb9531.zip |
Make Python problems non-fatal
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r-- | pcilib/pci.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index ec40c95..c9cd1d2 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -147,9 +147,8 @@ pcilib_t *pcilib_open(const char *device, const char *model) { err = pcilib_init_py(ctx); if (err) { - pcilib_error("Error (%i) initializing python subsystem", err); - pcilib_close(ctx); - return NULL; + pcilib_warning("Error (%i) initializing python subsystem", err); + pcilib_free_py(ctx); } ctx->alloc_reg = PCILIB_DEFAULT_REGISTER_SPACE; @@ -191,22 +190,22 @@ pcilib_t *pcilib_open(const char *device, const char *model) { if (!ctx->model) ctx->model = strdup(model?model:"pci"); - + err = pcilib_py_add_script_dir(ctx, NULL); if (err) { - pcilib_error("Error (%i) add script path to python path", err); - pcilib_close(ctx); - return NULL; + pcilib_warning("Error (%i) add script path to python path", err); + pcilib_free_py(ctx); + err = 0; } - - + + xmlerr = pcilib_init_xml(ctx, ctx->model); if ((xmlerr)&&(xmlerr != PCILIB_ERROR_NOTFOUND)) { pcilib_error("Error (%i) initializing XML subsystem for model %s", xmlerr, ctx->model); pcilib_close(ctx); return NULL; } - + // We have found neither standard model nor XML if ((err)&&(xmlerr)) { |