From bd30f9451a3f775e7db30a9c405e4db9d4c259b8 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Tue, 3 Jun 2014 21:43:27 +0400 Subject: get out of SPINLOCK_INITIALIZER as it is not cross-platform compatible --- accel-pppd/logs/log_pgsql.c | 4 +++- accel-pppd/logs/log_syslog.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'accel-pppd/logs') diff --git a/accel-pppd/logs/log_pgsql.c b/accel-pppd/logs/log_pgsql.c index 1a62a9ab..0c2152e7 100644 --- a/accel-pppd/logs/log_pgsql.c +++ b/accel-pppd/logs/log_pgsql.c @@ -36,7 +36,7 @@ static PGconn *conn; static LIST_HEAD(msg_queue); static int queue_size; static int sleeping = 0; -static spinlock_t queue_lock = SPINLOCK_INITIALIZER; +static spinlock_t queue_lock; static char *log_buf; static int need_close; @@ -284,6 +284,8 @@ static void init(void) { char *opt; + spinlock_init(&queue_lock); + opt = conf_get_opt("log-pgsql", "conninfo"); if (!opt) return; diff --git a/accel-pppd/logs/log_syslog.c b/accel-pppd/logs/log_syslog.c index cbab5252..b0b079aa 100644 --- a/accel-pppd/logs/log_syslog.c +++ b/accel-pppd/logs/log_syslog.c @@ -25,7 +25,7 @@ static struct triton_context_t syslog_ctx = { static LIST_HEAD(msg_queue); static int queue_size; static int sleeping = 1; -static spinlock_t queue_lock = SPINLOCK_INITIALIZER; +static spinlock_t queue_lock; static char *log_buf; static int need_close; static char *ident; @@ -180,6 +180,8 @@ static void load_config() static void init(void) { + spinlock_init(&queue_lock); + log_buf = malloc(LOG_MAX_SIZE + 1); load_config(); -- cgit v1.2.3