mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 21:09:28 +00:00
Save errno before calling pthread_mutex_lock because pthread_mutex_lock
may change errno unexpectly.
This commit is contained in:
parent
e92b415c5a
commit
3a31b448c0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158426
@ -153,6 +153,8 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
|||||||
pri &= LOG_PRIMASK|LOG_FACMASK;
|
pri &= LOG_PRIMASK|LOG_FACMASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saved_errno = errno;
|
||||||
|
|
||||||
THREAD_LOCK();
|
THREAD_LOCK();
|
||||||
|
|
||||||
/* Check priority against setlogmask values. */
|
/* Check priority against setlogmask values. */
|
||||||
@ -161,8 +163,6 @@ vsyslog(int pri, const char *fmt, va_list ap)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
saved_errno = errno;
|
|
||||||
|
|
||||||
/* Set default facility if none specified. */
|
/* Set default facility if none specified. */
|
||||||
if ((pri & LOG_FACMASK) == 0)
|
if ((pri & LOG_FACMASK) == 0)
|
||||||
pri |= LogFacility;
|
pri |= LogFacility;
|
||||||
|
Loading…
Reference in New Issue
Block a user