Merge "clang-format: Double-indent continuation lines"
diff --git a/OWNERS b/OWNERS
index 1d319af..682a067 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,5 +1 @@
enh@google.com
-per-file libsysutils/src/Netlink* = ek@google.com
-per-file libsysutils/src/Netlink* = lorenzo@google.com
-per-file libsysutils/include/sysutils/Netlink* = ek@google.com
-per-file libsysutils/include/sysutils/Netlink* = lorenzo@google.com
diff --git a/adb/client/usb_windows.cpp b/adb/client/usb_windows.cpp
index 9751ebf..f529e8f 100644
--- a/adb/client/usb_windows.cpp
+++ b/adb/client/usb_windows.cpp
@@ -75,7 +75,7 @@
static const GUID usb_class_id = ANDROID_USB_CLASS_ID;
/// List of opened usb handles
-static std::vector<usb_handle*> handle_list;
+static std::vector<usb_handle*>& handle_list = *new std::vector<usb_handle*>();
/// Locker for the list of opened usb handles
static std::mutex& usb_lock = *new std::mutex();
diff --git a/base/logging.cpp b/base/logging.cpp
index 978d56d..35054ac 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -58,13 +58,15 @@
#include <android-base/strings.h>
#include <android-base/threads.h>
-namespace {
+namespace android {
+namespace base {
+
+// BSD-based systems like Android/macOS have getprogname(). Others need us to provide one.
+#if defined(__GLIBC__) || defined(_WIN32)
+static const char* getprogname() {
#if defined(__GLIBC__)
-const char* getprogname() {
return program_invocation_short_name;
-}
#elif defined(_WIN32)
-const char* getprogname() {
static bool first = true;
static char progname[MAX_PATH] = {};
@@ -81,11 +83,28 @@
}
return progname;
+#endif
}
#endif
+static const char* GetFileBasename(const char* file) {
+ // We can't use basename(3) even on Unix because the Mac doesn't
+ // have a non-modifying basename.
+ const char* last_slash = strrchr(file, '/');
+ if (last_slash != nullptr) {
+ return last_slash + 1;
+ }
+#if defined(_WIN32)
+ const char* last_backslash = strrchr(file, '\\');
+ if (last_backslash != nullptr) {
+ return last_backslash + 1;
+ }
+#endif
+ return file;
+}
+
#if defined(__linux__)
-int OpenKmsg() {
+static int OpenKmsg() {
#if defined(__ANDROID__)
// pick up 'file w /dev/kmsg' environment from daemon's init rc file
const auto val = getenv("ANDROID_FILE__dev_kmsg");
@@ -100,10 +119,6 @@
return TEMP_FAILURE_RETRY(open("/dev/kmsg", O_WRONLY | O_CLOEXEC));
}
#endif
-} // namespace
-
-namespace android {
-namespace base {
static std::mutex& LoggingLock() {
static auto& logging_lock = *new std::mutex();
@@ -216,7 +231,7 @@
unsigned int /*line*/, const char* message) {
if (severity >= WARNING) {
fflush(stdout);
- fprintf(stderr, "%s: %s\n", getprogname(), message);
+ fprintf(stderr, "%s: %s\n", GetFileBasename(getprogname()), message);
} else {
fprintf(stdout, "%s\n", message);
}
@@ -336,22 +351,6 @@
Aborter() = std::move(aborter);
}
-static const char* GetFileBasename(const char* file) {
- // We can't use basename(3) even on Unix because the Mac doesn't
- // have a non-modifying basename.
- const char* last_slash = strrchr(file, '/');
- if (last_slash != nullptr) {
- return last_slash + 1;
- }
-#if defined(_WIN32)
- const char* last_backslash = strrchr(file, '\\');
- if (last_backslash != nullptr) {
- return last_backslash + 1;
- }
-#endif
- return file;
-}
-
// This indirection greatly reduces the stack impact of having lots of
// checks/logging in a function.
class LogMessageData {
diff --git a/libsysutils/include/sysutils/OWNERS b/libsysutils/include/sysutils/OWNERS
new file mode 100644
index 0000000..b78918e
--- /dev/null
+++ b/libsysutils/include/sysutils/OWNERS
@@ -0,0 +1,2 @@
+per-file Netlink* = ek@google.com
+per-file Netlink* = lorenzo@google.com
diff --git a/libsysutils/src/OWNERS b/libsysutils/src/OWNERS
new file mode 100644
index 0000000..b78918e
--- /dev/null
+++ b/libsysutils/src/OWNERS
@@ -0,0 +1,2 @@
+per-file Netlink* = ek@google.com
+per-file Netlink* = lorenzo@google.com
diff --git a/libunwindstack/Android.bp b/libunwindstack/Android.bp
index 26be64d..d4cef7c 100644
--- a/libunwindstack/Android.bp
+++ b/libunwindstack/Android.bp
@@ -232,6 +232,9 @@
"tests/files/offline/straddle_arm/*",
"tests/files/offline/straddle_arm64/*",
],
+ required: [
+ "libunwindstack_local",
+ ],
}
//-------------------------------------------------------------------------