diff options
author | zilio nicolas <nicolas.zilio@kit.edu> | 2015-07-07 11:12:52 +0200 |
---|---|---|
committer | zilio nicolas <nicolas.zilio@kit.edu> | 2015-07-07 11:12:52 +0200 |
commit | f923add0a9b6bd17d43f72c21eec4e01e19240cf (patch) | |
tree | 8f737e8bd5faa360dfef5b33c52a0f58679c4b8d /pcilib/pci.c | |
parent | e2515f6e1a7b17addda4c558a0a6ca05b4ec6e55 (diff) | |
download | pcitool-f923add0a9b6bd17d43f72c21eec4e01e19240cf.tar.gz pcitool-f923add0a9b6bd17d43f72c21eec4e01e19240cf.tar.bz2 pcitool-f923add0a9b6bd17d43f72c21eec4e01e19240cf.tar.xz pcitool-f923add0a9b6bd17d43f72c21eec4e01e19240cf.zip |
clean version for locks
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r-- | pcilib/pci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index 3a18ccd..c7b86e8 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -1,4 +1,5 @@ //#define PCILIB_FILE_IO +#define _XOPEN_SOURCE 700 #define _BSD_SOURCE #define _POSIX_C_SOURCE 200809L @@ -24,6 +25,7 @@ #include "model.h" #include "plugin.h" #include "bar.h" +#include "locking.h" static int pcilib_detect_model(pcilib_t *ctx, const char *model) { int i, j; @@ -159,6 +161,12 @@ pcilib_t *pcilib_open(const char *device, const char *model) { ctx->model_info.protocols = ctx->protocols; ctx->model_info.ranges = ctx->ranges; + err=pcilib_init_locking(ctx); + if (err) { + pcilib_error("Error (%i) initializing locking\n", err); + pcilib_close(ctx); + return NULL; + } err = pcilib_init_register_banks(ctx); if (err) { |