diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index 98642e9c..58554aa2 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -36,6 +36,7 @@ static pool *log_pool; static struct rfile *dbg_rf; static char *current_syslog_name = NULL; /* NULL -> syslog closed */ +const char *bird_name = NULL; _Atomic uint max_thread_id = 1; _Thread_local uint this_thread_id; @@ -826,6 +827,7 @@ resolve_fail: void log_init_debug(char *f) { + ASSERT_DIE(bird_name); clock_gettime(CLOCK_MONOTONIC, &dbg_time_start); if (dbg_rf && dbg_rf != &rf_stderr) diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 254690b1..ed5569d8 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -709,7 +709,6 @@ signal_init(void) static char *opt_list = "bc:dD:ps:P:u:g:flRh"; int parse_and_exit; -char *bird_name; static char *use_user; static char *use_group; static int run_in_foreground = 0; diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h index 5e2144e4..7832caaa 100644 --- a/sysdep/unix/unix.h +++ b/sysdep/unix/unix.h @@ -24,7 +24,7 @@ struct config; /* main.c */ -extern char *bird_name; +extern const char *bird_name; extern int parse_and_exit; void async_config(void); void async_dump(void); diff --git a/test/birdtest.c b/test/birdtest.c index 76bae76d..2072ada9 100644 --- a/test/birdtest.c +++ b/test/birdtest.c @@ -539,7 +539,6 @@ bt_is_char(byte c) */ int parse_and_exit; -char *bird_name; void async_config(void) {} void async_dump(void) {} void async_shutdown(void) {}