From: Rich Felker Date: Wed, 4 Mar 2015 14:44:43 +0000 (-0500) Subject: eliminate atomics in syslog setlogmask function X-Git-Tag: v1.1.7~25 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6de071a0be00ec2ff08af3c89c7caaa20f1044d7;p=oweals%2Fmusl.git eliminate atomics in syslog setlogmask function --- diff --git a/src/misc/syslog.c b/src/misc/syslog.c index b934a686..e026f9b4 100644 --- a/src/misc/syslog.c +++ b/src/misc/syslog.c @@ -10,19 +10,21 @@ #include #include #include "libc.h" -#include "atomic.h" static volatile int lock[2]; static char log_ident[32]; static int log_opt; static int log_facility = LOG_USER; -static volatile int log_mask = 0xff; +static int log_mask = 0xff; static int log_fd = -1; int setlogmask(int maskpri) { - if (maskpri) return a_swap(&log_mask, maskpri); - else return log_mask; + LOCK(lock); + int ret = log_mask; + if (maskpri) log_mask = maskpri; + UNLOCK(lock); + return ret; } static const struct {