wsd: always use signal-safe calls

The async-signal-safe functions to get thread-id
and thread-name, which cache the results, are
faster, cleaner, and signal-safe. No reason why
we shouldn't always use them.

Especially since it appears the logic was
inverted in Log::prefix, such that the signal
un-safe calls were made during signal-handling,
and the safe ones were called otherwise!

Instead of passing the signal-safe flag to
Log::prefix, we pass the buffer size, for
improved security.

Furthermore, reduce header dependencies
and reduce clutter.

Change-Id: I697689b2f0a290b6d8cce4babc3ac1e576141da6
This commit is contained in:
Ashod Nakashian
2018-06-04 16:47:39 -04:00
parent 63c3fce2c6
commit 3158d4c31c
6 changed files with 45 additions and 48 deletions

View File

@ -12,6 +12,9 @@
*/
#include <config.h>
#include "Seccomp.hpp"
#include <dlfcn.h>
#include <ftw.h>
#include <linux/audit.h>
@ -31,7 +34,6 @@
#include <common/Log.hpp>
#include <common/SigUtil.hpp>
#include "Seccomp.hpp"
#if DISABLE_SECCOMP == 0
#ifndef SYS_SECCOMP