]> git.sur5r.net Git - i3/i3/commitdiff
shm_unlink the created/open shm
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 20 Mar 2013 15:59:55 +0000 (16:59 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 20 Mar 2013 16:26:14 +0000 (17:26 +0100)
src/log.c

index e858f94e1b13f9892862b6699474474a0dd5dec7..e490cf31651906ecbef5240d3f438bc9cf2141eb 100644 (file)
--- 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;