Save errno before calling pthread_mutex_lock because pthread_mutex_lock
may change errno unexpectly.
This commit is contained in:
parent
e92b415c5a
commit
3a31b448c0
@ -153,6 +153,8 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
pri &= LOG_PRIMASK|LOG_FACMASK;
|
||||
}
|
||||
|
||||
saved_errno = errno;
|
||||
|
||||
THREAD_LOCK();
|
||||
|
||||
/* Check priority against setlogmask values. */
|
||||
@ -161,8 +163,6 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
||||
return;
|
||||
}
|
||||
|
||||
saved_errno = errno;
|
||||
|
||||
/* Set default facility if none specified. */
|
||||
if ((pri & LOG_FACMASK) == 0)
|
||||
pri |= LogFacility;
|
||||
|
Loading…
Reference in New Issue
Block a user