diff --git a/include/shmlog.h b/include/shmlog.h index fd3f53eb..94da2bdb 100644 --- a/include/shmlog.h +++ b/include/shmlog.h @@ -14,6 +14,9 @@ #include #include +/* Default shmlog size if not set by user. */ +extern const int default_shmlog_size; + /* * Header of the shmlog file. Used by i3/src/log.c and i3/i3-dump-log/main.c. * diff --git a/src/main.c b/src/main.c index db3aca49..0912d48e 100644 --- a/src/main.c +++ b/src/main.c @@ -19,6 +19,7 @@ #include #include #include "all.h" +#include "shmlog.h" #include "sd-daemon.h" @@ -67,6 +68,9 @@ xcb_key_symbols_t *keysyms; /* Those are our connections to X11 for use with libXcursor and XKB */ Display *xlibdpy, *xkbdpy; +/* Default shmlog size if not set by user. */ +const int default_shmlog_size = 25 * 1024 * 1024; + /* The list of key bindings */ struct bindings_head *bindings; @@ -291,7 +295,7 @@ int main(int argc, char *argv[]) { init_logging(); /* On non-release builds, disable SHM logging by default. */ - shmlog_size = (is_debug_build() ? 25 * 1024 * 1024 : 0); + shmlog_size = (is_debug_build() ? default_shmlog_size : 0); start_argv = argv;