Merge pull request #9726 from dkozovsk/master

signal safety fixes exit ->_exit, call of page_size to prevent call of sysconf from signal handler
This commit is contained in:
Lennart Poettering 2018-07-27 09:56:24 +02:00 committed by GitHub
commit 4d7293f07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -113,6 +113,10 @@ void sigbus_install(void) {
.sa_flags = SA_SIGINFO,
};
/* make sure that sysconf() is not called from a signal handler because
* it is not guaranteed to be async-signal-safe since POSIX.1-2008 */
(void) page_size();
n_installed++;
if (n_installed == 1)

View File

@ -59,7 +59,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
_noreturn_ static void sig_alrm(int signo)
{
exit(4);
_exit(4);
}
static void usage(void)