X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=blobdiff_plain;f=i3-dump-log%2Fmain.c;h=4a11d218298f7a2c0515f940b9586a55d3f0250c;hp=48465c75718e696a44779638a5198f98c1e993dd;hb=4273db04445046499f6e259678665b917498d29b;hpb=61a5b9ddd4806cd65820717dd3d0e3fda8a68cba diff --git a/i3-dump-log/main.c b/i3-dump-log/main.c index 48465c75..4a11d218 100644 --- a/i3-dump-log/main.c +++ b/i3-dump-log/main.c @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) { struct stat statbuf; - /* NB: While we must never read, we need O_RDWR for the pthread condvar. */ + /* NB: While we must never write, we need O_RDWR for the pthread condvar. */ int logbuffer_shm = shm_open(shmname, O_RDWR, 0); if (logbuffer_shm == -1) err(EXIT_FAILURE, "Could not shm_open SHM segment for the i3 log (%s)", shmname); @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { if (fstat(logbuffer_shm, &statbuf) != 0) err(EXIT_FAILURE, "stat(%s)", shmname); - /* NB: While we must never read, we need O_RDWR for the pthread condvar. */ + /* NB: While we must never write, we need PROT_WRITE for the pthread condvar. */ logbuffer = mmap(NULL, statbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, logbuffer_shm, 0); if (logbuffer == MAP_FAILED) err(EXIT_FAILURE, "Could not mmap SHM segment for the i3 log");