mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
(log_cleanup): New function. (openlog): Use log_cleanup instead of __libc_mutex_unlock. (closelog): Likewise.
This commit is contained in:
@ -329,14 +329,19 @@ openlog_internal(const char *ident, int logstat, int logfac)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
log_cleanup (void *arg)
|
||||||
|
{
|
||||||
|
__libc_lock_unlock (*(__libc_lock_t *) arg);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
openlog (const char *ident, int logstat, int logfac)
|
openlog (const char *ident, int logstat, int logfac)
|
||||||
{
|
{
|
||||||
#ifdef _LIBC_REENTRANT
|
#ifdef _LIBC_REENTRANT
|
||||||
/* Protect against multiple users. */
|
/* Protect against multiple users. */
|
||||||
__libc_cleanup_region_start (1,
|
__libc_cleanup_region_start (1, log_cleanup, &syslog_lock);
|
||||||
(void (*) __P ((void *))) __libc_mutex_unlock,
|
|
||||||
&syslog_lock);
|
|
||||||
__libc_lock_lock (syslog_lock);
|
__libc_lock_lock (syslog_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -370,9 +375,7 @@ closelog ()
|
|||||||
{
|
{
|
||||||
#ifdef _LIBC_REENTRANT
|
#ifdef _LIBC_REENTRANT
|
||||||
/* Protect against multiple users. */
|
/* Protect against multiple users. */
|
||||||
__libc_cleanup_region_start (1,
|
__libc_cleanup_region_start (1, log_cleanup, &syslog_lock);
|
||||||
(void (*) __P ((void *))) __libc_mutex_unlock,
|
|
||||||
&syslog_lock);
|
|
||||||
__libc_lock_lock (syslog_lock);
|
__libc_lock_lock (syslog_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user