Merge "Remove unused cruft from <log/log.h>."
diff --git a/adb/adb.h b/adb/adb.h
index 9020fc3..59644d4 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -142,10 +142,10 @@
void print_packet(const char *label, apacket *p);
-
-
-void fatal(const char *fmt, ...) __attribute__((noreturn));
-void fatal_errno(const char *fmt, ...) __attribute__((noreturn));
+// These use the system (v)fprintf, not the adb prefixed ones defined in sysdeps.h, so they
+// shouldn't be tagged with ADB_FORMAT_ARCHETYPE.
+void fatal(const char* fmt, ...) __attribute__((noreturn, format(__printf__, 1, 2)));
+void fatal_errno(const char* fmt, ...) __attribute__((noreturn, format(__printf__, 1, 2)));
void handle_packet(apacket *p, atransport *t);
diff --git a/adb/sysdeps_win32.cpp b/adb/sysdeps_win32.cpp
index 0a2a8f6..c3889b6 100644
--- a/adb/sysdeps_win32.cpp
+++ b/adb/sysdeps_win32.cpp
@@ -88,7 +88,10 @@
_fh_socket_hook
};
-#define assert(cond) do { if (!(cond)) fatal( "assertion failed '%s' on %s:%ld\n", #cond, __FILE__, __LINE__ ); } while (0)
+#define assert(cond) \
+ do { \
+ if (!(cond)) fatal("assertion failed '%s' on %s:%d\n", #cond, __FILE__, __LINE__); \
+ } while (0)
std::string SystemErrorCodeToString(const DWORD error_code) {
const int kErrorMessageBufferSize = 256;
@@ -1589,7 +1592,7 @@
/**************************************************************************/
/**************************************************************************/
-#define FATAL(x...) fatal(__FUNCTION__, x)
+#define FATAL(fmt, ...) fatal("%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
#if DEBUG
static void dump_fde(fdevent *fde, const char *info)
diff --git a/libbacktrace/backtrace_test.cpp b/libbacktrace/backtrace_test.cpp
index 23636db..7d829fe 100644
--- a/libbacktrace/backtrace_test.cpp
+++ b/libbacktrace/backtrace_test.cpp
@@ -1156,7 +1156,7 @@
int fd = open(tmp_so_name, O_RDONLY);
ASSERT_TRUE(fd != -1);
- void* map = mmap(NULL, map_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ void* map = mmap(NULL, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
ASSERT_TRUE(map != MAP_FAILED);
close(fd);
ASSERT_TRUE(unlink(tmp_so_name) != -1);
@@ -1206,7 +1206,7 @@
exit(0);
}
- void* map = mmap(NULL, map_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ void* map = mmap(NULL, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
if (map == MAP_FAILED) {
fprintf(stderr, "Failed to map in memory: %s\n", strerror(errno));
unlink(tmp_so_name);