From 684a77442e496ae86e895751fdae2a0abb43234e Mon Sep 17 00:00:00 2001 From: Alexander Berntsen Date: Wed, 5 Jun 2013 14:59:05 +0200 Subject: [PATCH] Make default shmlog_size a const int --- include/shmlog.h | 3 +++ src/main.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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; -- 2.39.5