Save errno before calling pthread_mutex_lock because pthread_mutex_lock

may change errno unexpectly.
This commit is contained in:
David Xu 2006-05-11 09:10:33 +00:00
parent e92b415c5a
commit 3a31b448c0

View File

@ -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;