diff options
author | Josh Gao <jmgao@google.com> | 2021-01-26 17:45:43 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2021-01-27 15:52:43 -0800 |
commit | 618cea3ebda342b39db103ac85e96a541d67b1f7 (patch) | |
tree | b235edbe96d90d6541fbfed760e4398962e0b651 /debuggerd/libdebuggerd/utility.cpp | |
parent | 76e1e30f16d8de3e0de2dabcef3c774973b9dd9c (diff) |
Remove use of libbase logging in libdebuggerd.
libbase logging uses getprogname() to get the default tag, which breaks
for the fallback handler which is statically linked into the dynamic
linker. Switch to libasync_safe for logging.
Test: atest -c CtsSeccompHostTestCases:android.seccomp.cts.SeccompHostJUnit4DeviceTest#testAppZygoteSyscalls
Change-Id: Ieeaf33fb26cff4ba7e1589d1d883ac2fcc74cf47
Diffstat (limited to 'debuggerd/libdebuggerd/utility.cpp')
-rw-r--r-- | debuggerd/libdebuggerd/utility.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp index f406ad48e..f941990d0 100644 --- a/debuggerd/libdebuggerd/utility.cpp +++ b/debuggerd/libdebuggerd/utility.cpp @@ -30,11 +30,11 @@ #include <string> -#include <android-base/logging.h> #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> +#include <async_safe/log.h> #include <bionic/reserved_signals.h> #include <debuggerd/handler.h> #include <log/log.h> @@ -259,11 +259,11 @@ void drop_capabilities() { memset(&capdata, 0, sizeof(capdata)); if (capset(&capheader, &capdata[0]) == -1) { - PLOG(FATAL) << "failed to drop capabilities"; + async_safe_fatal("failed to drop capabilities: %s", strerror(errno)); } if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) != 0) { - PLOG(FATAL) << "failed to set PR_SET_NO_NEW_PRIVS"; + async_safe_fatal("failed to set PR_SET_NO_NEW_PRIVS: %s", strerror(errno)); } } |