summaryrefslogtreecommitdiffstats
path: root/syslog.c
diff options
context:
space:
mode:
Diffstat (limited to 'syslog.c')
-rw-r--r--syslog.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/syslog.c b/syslog.c
index d5766f95..e0242729 100644
--- a/syslog.c
+++ b/syslog.c
@@ -91,13 +91,14 @@ void syslog_init(void)
val openlog_wrap(val wident, val optmask, val facility)
{
static char *ident;
+ cnum coptmask = c_num(default_arg(optmask, zero));
+ cnum cfacility = c_num(default_arg(facility, num_fast(LOG_USER)));
char *old_ident = ident;
- optmask = default_arg(optmask, zero);
- facility = default_arg(facility, num_fast(LOG_USER));
-
ident = utf8_dup_to(c_str(wident));
- openlog(ident, c_num(optmask), c_num(facility));
+
+ openlog(ident, coptmask, cfacility);
+
free(old_ident);
return nil;
@@ -111,8 +112,9 @@ val setlogmask_wrap(val mask)
val syslog_wrapv(val prio, val fmt, struct args *args)
{
val text = formatv(nil, fmt, args);
+ cnum cprio = c_num(prio);
char *u8text = utf8_dup_to(c_str(text));
- syslog(c_num(prio), "%s", u8text);
+ syslog(cprio, "%s", u8text);
return nil;
}