shm_unlink the created/open shm
Patch status: merged
Patch by Baptiste Daroussin
To apply this patch, use:
curl http://cr.i3wm.org/patch/101/raw.patch | git am
b/src/log.c
13 |
@@ -116,7 +116,7 @@ void init_logging(void) { |
14 |
|
15 |
if (ftruncate(logbuffer_shm, logbuffer_size) == -1) { |
16 |
close(logbuffer_shm); |
17 |
- shm_unlink("/i3-log-"); |
18 |
+ shm_unlink(shmlogname); |
19 |
fprintf(stderr, "Could not ftruncate SHM segment for the i3 log: %s\n", strerror(errno)); |
20 |
return; |
21 |
} |
22 |
@@ -124,7 +124,7 @@ void init_logging(void) { |
23 |
logbuffer = mmap(NULL, logbuffer_size, PROT_READ | PROT_WRITE, MAP_SHARED, logbuffer_shm, 0); |
24 |
if (logbuffer == MAP_FAILED) { |
25 |
close(logbuffer_shm); |
26 |
- shm_unlink("/i3-log-"); |
27 |
+ shm_unlink(shmlogname); |
28 |
fprintf(stderr, "Could not mmap SHM segment for the i3 log: %s\n", strerror(errno)); |
29 |
logbuffer = NULL; |
30 |
return; |