Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ed4d4d4 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "adb: tag fatal, fatal_errno with printf attribute." am: 7db2cb67

am: a05fbcff

* commit 'a05fbcff':
  adb: tag fatal, fatal_errno with printf attribute.
parents c93cf8a7 a05fbcff
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -142,10 +142,10 @@ struct alistener


void print_packet(const char *label, apacket *p);
void print_packet(const char *label, apacket *p);



// 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));
void fatal(const char* fmt, ...) __attribute__((noreturn, format(__printf__, 1, 2)));
void fatal_errno(const char *fmt, ...) __attribute__((noreturn));
void fatal_errno(const char* fmt, ...) __attribute__((noreturn, format(__printf__, 1, 2)));


void handle_packet(apacket *p, atransport *t);
void handle_packet(apacket *p, atransport *t);


+5 −2
Original line number Original line Diff line number Diff line
@@ -88,7 +88,10 @@ static const FHClassRec _fh_socket_class = {
    _fh_socket_hook
    _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) {
std::string SystemErrorCodeToString(const DWORD error_code) {
  const int kErrorMessageBufferSize = 256;
  const int kErrorMessageBufferSize = 256;
@@ -1589,7 +1592,7 @@ int adb_socketpair(int sv[2]) {
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/


#define FATAL(x...) fatal(__FUNCTION__, x)
#define FATAL(fmt, ...) fatal("%s: " fmt, __FUNCTION__, ##__VA_ARGS__)


#if DEBUG
#if DEBUG
static void dump_fde(fdevent *fde, const char *info)
static void dump_fde(fdevent *fde, const char *info)