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

Commit 892f0e93 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "adb/base: minor compiler portability improvements"

parents 24e3b8d0 363af568
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ void adb_trace_init(char** argv) {
    }
#endif

    android::base::InitLogging(argv, AdbLogger);
    android::base::InitLogging(argv, &AdbLogger);
    setup_trace_mask();

    VLOG(ADB) << adb_version();
+2 −5
Original line number Diff line number Diff line
@@ -182,11 +182,8 @@ std::string dump_hex(const void* data, size_t byte_count) {
    line.push_back(' ');

    for (size_t i = 0; i < byte_count; ++i) {
        int c = p[i];
        if (c < 32 || c > 127) {
            c = '.';
        }
        line.push_back(c);
        int ch = p[i];
        line.push_back(isprint(ch) ? ch : '.');
    }

    return line;
+1 −1
Original line number Diff line number Diff line
@@ -753,7 +753,7 @@ static int set_time_and_mode(const char *lpath, time_t time, unsigned int mode)
    umask(mask);
    int r2 = chmod(lpath, mode & ~mask);

    return r1 ? : r2;
    return r1 ? r1 : r2;
}

static bool copy_remote_dir_local(SyncConnection& sc, std::string rpath,
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
#include <string.h>
#include <unistd.h>

#include <algorithm>

#if !ADB_HOST
#include "cutils/properties.h"
#endif
+6 −1
Original line number Diff line number Diff line
@@ -309,7 +309,12 @@ extern char* adb_getcwd(char* buf, int size);
#define closedir adb_closedir
#define rewinddir rewinddir_utf8_not_yet_implemented
#define telldir telldir_utf8_not_yet_implemented
#define seekdir seekdir_utf8_not_yet_implemented
// Some compiler's C++ headers have members named seekdir, so we can't do the
// macro technique and instead cause a link error if seekdir is called.
inline void seekdir(DIR*, long) {
    extern int seekdir_utf8_not_yet_implemented;
    seekdir_utf8_not_yet_implemented = 1;
}

#define utime adb_utime
#define chmod adb_chmod
Loading