]> git.sur5r.net Git - i3/i3/commitdiff
FreeBSD expect a real path on the filesystem for shm_open
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 20 Mar 2013 16:01:12 +0000 (17:01 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 20 Mar 2013 16:29:06 +0000 (17:29 +0100)
src/log.c

index e490cf31651906ecbef5240d3f438bc9cf2141eb..0269fb21ff9b7078a6f94ecd787c7e4a2dd4a1f6 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -107,7 +107,11 @@ void init_logging(void) {
                                         sysconf(_SC_PAGESIZE);
 #endif
         logbuffer_size = min(physical_mem_bytes * 0.01, shmlog_size);
+#if defined(__FreeBSD__)
+        sasprintf(&shmlogname, "/tmp/i3-log-%d", getpid());
+#else
         sasprintf(&shmlogname, "/i3-log-%d", getpid());
+#endif
         logbuffer_shm = shm_open(shmlogname, O_RDWR | O_CREAT, S_IREAD | S_IWRITE);
         if (logbuffer_shm == -1) {
             fprintf(stderr, "Could not shm_open SHM segment for the i3 log: %s\n", strerror(errno));