shmlog: Remove O_TRUNC flag for shm_open, we truncate ourselves

next
Michael Stapelberg 2012-10-04 17:05:08 +02:00
parent b943e3807d
commit 2eeb2a1067
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ void init_logging(void) {
#endif
logbuffer_size = min(physical_mem_bytes * 0.01, shmlog_size);
sasprintf(&shmlogname, "/i3-log-%d", getpid());
logbuffer_shm = shm_open(shmlogname, O_RDWR | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
logbuffer_shm = shm_open(shmlogname, O_RDWR | O_CREAT, S_IREAD | S_IWRITE);
if (logbuffer_shm == -1) {
ELOG("Could not shm_open SHM segment for the i3 log: %s\n", strerror(errno));
return;