i3 - improved tiling WM


Make default shmlog_size a const int

Patch status: merged

Patch by Alexander Berntsen

To apply this patch, use:
curl http://cr.i3wm.org/patch/174/raw.patch | git am

b/include/shmlog.h

14
@@ -14,6 +14,9 @@
15
 #include <stdint.h>
16
 #include <pthread.h>
17
 
18
+/* Default shmlog size if not set by user. */
19
+extern const int default_shmlog_size;
20
+
21
 /*
22
  * Header of the shmlog file. Used by i3/src/log.c and i3/i3-dump-log/main.c.
23
  *

b/src/main.c

28
@@ -19,6 +19,7 @@
29
 #include <sys/mman.h>
30
 #include <sys/stat.h>
31
 #include "all.h"
32
+#include "shmlog.h"
33
 
34
 #include "sd-daemon.h"
35
 
36
@@ -67,6 +68,9 @@ xcb_key_symbols_t *keysyms;
37
 /* Those are our connections to X11 for use with libXcursor and XKB */
38
 Display *xlibdpy, *xkbdpy;
39
 
40
+/* Default shmlog size if not set by user. */
41
+const int default_shmlog_size = 25 * 1024 * 1024;
42
+
43
 /* The list of key bindings */
44
 struct bindings_head *bindings;
45
 
46
@@ -291,7 +295,7 @@ int main(int argc, char *argv[]) {
47
     init_logging();
48
 
49
     /* On non-release builds, disable SHM logging by default. */
50
-    shmlog_size = (is_debug_build() ? 25 * 1024 * 1024 : 0);
51
+    shmlog_size = (is_debug_build() ? default_shmlog_size : 0);
52
 
53
     start_argv = argv;
54