Hi,

syslog_r() expects a priority, not a faciliy.  The result of the
misused LOG_USER was an emerg log.  Better use LOG_ERR.

ok?

bluhm

Index: lib/librthread/rthread_attr.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/lib/librthread/rthread_attr.c,v
retrieving revision 1.24
diff -u -p -r1.24 rthread_attr.c
--- lib/librthread/rthread_attr.c       12 Apr 2018 17:15:34 -0000      1.24
+++ lib/librthread/rthread_attr.c       30 Apr 2018 22:07:09 -0000
@@ -126,7 +126,7 @@ pthread_attr_setstack(pthread_attr_t *at
        struct syslog_data data = SYSLOG_DATA_INIT;
 
        if (stacksize < PTHREAD_STACK_MIN) {
-               syslog_r(LOG_USER, &data,
+               syslog_r(LOG_ERR, &data,
                    "pthread_attr_setstack(%p, %zu): "
                    "stack size below min size %d",
                    stackaddr, stacksize, PTHREAD_STACK_MIN);
@@ -139,7 +139,7 @@ pthread_attr_setstack(pthread_attr_t *at
         */
        if (((uintptr_t)stackaddr % PTHREAD_STACK_MIN) != 0
            || (stacksize % PTHREAD_STACK_MIN) != 0) {
-               syslog_r(LOG_USER, &data,
+               syslog_r(LOG_ERR, &data,
                    "pthread_attr_setstack(%p, 0x%zx): "
                    "unaligned thread stack start and/or size",
                    stackaddr, stacksize);
@@ -163,7 +163,7 @@ pthread_attr_setstack(pthread_attr_t *at
 
        if (mmap(stackaddr, stacksize, PROT_READ|PROT_WRITE,
            MAP_FIXED|MAP_STACK|MAP_ANON|MAP_PRIVATE, -1, 0) == MAP_FAILED) {
-               syslog_r(LOG_USER, &data,
+               syslog_r(LOG_ERR, &data,
                    "pthread_attr_setstack(%p, %zu): mmap error %m",
                    stackaddr, stacksize);
                return (errno);

Reply via email to