#include <errno.h>
#include <fcntl.h>
#include "libc.h"
-#include "atomic.h"
-static int lock[2];
+static volatile int lock[2];
static char log_ident[32];
static int log_opt;
static int log_facility = LOG_USER;
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 {
char timebuf[16];
time_t now;
struct tm tm;
- char buf[256];
+ char buf[1024];
int errno_save = errno;
int pid;
int l, l2;