diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-07-07 15:12:42 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-07-07 15:12:42 +0200 |
commit | 04a8f3ceedefa63f9344311e5ff05ab3ce754fda (patch) | |
tree | b95e680ff8e2ef267587f959ab0a7f6ae5d93227 /src/lib/shm_du_map.c | |
parent | 80441117cf61137c6a8c97e0779e70d76ae8541d (diff) | |
download | ouroboros-04a8f3ceedefa63f9344311e5ff05ab3ce754fda.tar.gz ouroboros-04a8f3ceedefa63f9344311e5ff05ab3ce754fda.zip |
lib: Add lockfile
The pid of the IRMd is stored in a lockfile in shared memory. This
makes checking if the IRMd is running independent of the
configuration, as previously the IRMd pid was stored at the end of the
shm_du_map, which could not be read by an IRMd that would be compiled
with different configuration options.
Also corrects some unnecessary includes
Fixes #21.
Diffstat (limited to 'src/lib/shm_du_map.c')
-rw-r--r-- | src/lib/shm_du_map.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/shm_du_map.c b/src/lib/shm_du_map.c index 53959676..01d1e23d 100644 --- a/src/lib/shm_du_map.c +++ b/src/lib/shm_du_map.c @@ -29,9 +29,11 @@ #include <pthread.h> #include <sys/mman.h> #include <fcntl.h> +#include <unistd.h> #include <stdlib.h> #include <string.h> #include <signal.h> +#include <errno.h> #include <sys/stat.h> #define OUROBOROS_PREFIX "shm_du_map" @@ -270,14 +272,6 @@ struct shm_du_map * shm_du_map_open() return dum; } -pid_t shm_du_map_owner(struct shm_du_map * dum) -{ - if (dum == NULL) - return -1; - - return *dum->api; -} - void * shm_du_map_sanitize(void * o) { struct shm_du_map * dum = (struct shm_du_map *) o; |