mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-13 23:00:22 +00:00
(vsyslog): Only use cleanup handler is _LIBC_REENTRANT is defined.
This commit is contained in:
parent
6b26e41662
commit
06a27948d0
@ -214,11 +214,13 @@ vsyslog(pri, fmt, ap)
|
|||||||
(void)__writev(STDERR_FILENO, iov, v - iov + 1);
|
(void)__writev(STDERR_FILENO, iov, v - iov + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
/* Prepare for multiple users. We have to take care: open and
|
/* Prepare for multiple users. We have to take care: open and
|
||||||
write are cancellation points. */
|
write are cancellation points. */
|
||||||
__libc_cleanup_region_start (1, (void (*) (void *)) cancel_handler,
|
__libc_cleanup_region_start (1, (void (*) (void *)) cancel_handler,
|
||||||
&oldaction_ptr);
|
&oldaction_ptr);
|
||||||
__libc_lock_lock (syslog_lock);
|
__libc_lock_lock (syslog_lock);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Prepare for a broken connection. */
|
/* Prepare for a broken connection. */
|
||||||
memset (&action, 0, sizeof (action));
|
memset (&action, 0, sizeof (action));
|
||||||
@ -268,9 +270,11 @@ vsyslog(pri, fmt, ap)
|
|||||||
if (sigpipe == 0)
|
if (sigpipe == 0)
|
||||||
__sigaction (SIGPIPE, &oldaction, (struct sigaction *) NULL);
|
__sigaction (SIGPIPE, &oldaction, (struct sigaction *) NULL);
|
||||||
|
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
/* End of critical section. */
|
/* End of critical section. */
|
||||||
__libc_cleanup_region_end (0);
|
__libc_cleanup_region_end (0);
|
||||||
__libc_lock_unlock (syslog_lock);
|
__libc_lock_unlock (syslog_lock);
|
||||||
|
#endif
|
||||||
|
|
||||||
free (buf);
|
free (buf);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user