diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-05-22 21:17:12 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-05-22 21:17:12 +0200 |
commit | ca0d5f79a77cc56d529d40f5802d9772ab729703 (patch) | |
tree | 37ebb2d5c4d5a266f6e298fc7960aa609c07bc0e /src/irmd/main.c | |
parent | 467e504993c1cb0351dc3e279e7aeab8e5df333f (diff) | |
parent | 9544da4a44f40f8c90b56b816a28fc6ac566d85d (diff) | |
download | ouroboros-ca0d5f79a77cc56d529d40f5802d9772ab729703.tar.gz ouroboros-ca0d5f79a77cc56d529d40f5802d9772ab729703.zip |
Merged in dstaesse/ouroboros/irmd-unique (pull request #107)0.1
irmd: use the shm_du_map as a uniqueness check
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r-- | src/irmd/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index a33fae84..b84c3327 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1487,8 +1487,13 @@ static struct irm * irm_create() if (i == NULL) return NULL; - if (access("/dev/shm/" SHM_DU_MAP_FILENAME, F_OK) != -1) - unlink("/dev/shm/" SHM_DU_MAP_FILENAME); + if (access("/dev/shm/" SHM_DU_MAP_FILENAME, F_OK) != -1) { + LOG_ERR("IRM daemon is running in this system."); + LOG_ERR("If you think this message is in error,"); + LOG_ERR("please remove /dev/shm/" SHM_DU_MAP_FILENAME); + LOG_ERR("(root privileges required) or reboot your system."); + return NULL; + } i->threadpool = malloc(sizeof(pthread_t) * IRMD_THREADPOOL_SIZE); if (i->threadpool == NULL) { |