Make default shmlog_size a const int

This commit is contained in:
Alexander Berntsen 2013-06-05 14:59:05 +02:00 committed by Michael Stapelberg
parent 58f3daac1d
commit 684a77442e
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,9 @@
#include <stdint.h> #include <stdint.h>
#include <pthread.h> #include <pthread.h>
/* 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. * Header of the shmlog file. Used by i3/src/log.c and i3/i3-dump-log/main.c.
* *

View File

@ -19,6 +19,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "all.h" #include "all.h"
#include "shmlog.h"
#include "sd-daemon.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 */ /* Those are our connections to X11 for use with libXcursor and XKB */
Display *xlibdpy, *xkbdpy; Display *xlibdpy, *xkbdpy;
/* Default shmlog size if not set by user. */
const int default_shmlog_size = 25 * 1024 * 1024;
/* The list of key bindings */ /* The list of key bindings */
struct bindings_head *bindings; struct bindings_head *bindings;
@ -291,7 +295,7 @@ int main(int argc, char *argv[]) {
init_logging(); init_logging();
/* On non-release builds, disable SHM logging by default. */ /* 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; start_argv = argv;