From: Baptiste Daroussin Date: Wed, 20 Mar 2013 15:59:55 +0000 (+0100) Subject: shm_unlink the created/open shm X-Git-Tag: 4.6~71 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=346cba0e0fd5e3c74b4e4821e8c18e754aa7a877;p=i3%2Fi3 shm_unlink the created/open shm --- diff --git a/src/log.c b/src/log.c index e858f94e..e490cf31 100644 --- a/src/log.c +++ b/src/log.c @@ -116,7 +116,7 @@ void init_logging(void) { if (ftruncate(logbuffer_shm, logbuffer_size) == -1) { close(logbuffer_shm); - shm_unlink("/i3-log-"); + shm_unlink(shmlogname); fprintf(stderr, "Could not ftruncate SHM segment for the i3 log: %s\n", strerror(errno)); return; } @@ -124,7 +124,7 @@ void init_logging(void) { logbuffer = mmap(NULL, logbuffer_size, PROT_READ | PROT_WRITE, MAP_SHARED, logbuffer_shm, 0); if (logbuffer == MAP_FAILED) { close(logbuffer_shm); - shm_unlink("/i3-log-"); + shm_unlink(shmlogname); fprintf(stderr, "Could not mmap SHM segment for the i3 log: %s\n", strerror(errno)); logbuffer = NULL; return;