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

Commit 21841d4b authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Gerrit Code Review
Browse files

Merge "Migrate gettid to GetThreadId" into main

parents 3062ca40 0de21957
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ package {
cc_defaults {
    name: "libstatspush_compat_defaults",
    srcs: [
        "statsd_writer.c",
        "statsd_writer.cpp",
        "stats_event_list.c",
        "StatsEventCompat.cpp"
    ],
+4 −4
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@
 */
#include "statsd_writer.h"

#include <android-base/threads.h>
#include <cutils/fs.h>
#include <cutils/sockets.h>
#include <cutils/threads.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
@@ -108,7 +108,7 @@ static int statsdOpen() {
                    case -ECONNREFUSED:
                    case -ENOENT:
                        i = atomic_exchange(&statsdLoggerWrite.sock, ret);
                    /* FALLTHRU */
                        break;
                    default:
                        break;
                }
@@ -188,7 +188,7 @@ static int statsdWrite(struct timespec* ts, struct iovec* vec, size_t nr) {
     *  };
     */

    header.tid = gettid();
    header.tid = android::base::GetThreadId();
    header.realtime.tv_sec = ts->tv_sec;
    header.realtime.tv_nsec = ts->tv_nsec;

@@ -272,7 +272,7 @@ static int statsdWrite(struct timespec* ts, struct iovec* vec, size_t nr) {
            if (ret < 0) {
                ret = -errno;
            }
        /* FALLTHRU */
            break;
        default:
            break;
    }
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
#include <stdatomic.h>
#include <sys/socket.h>

__BEGIN_DECLS

/**
 * Internal lock should not be exposed. This is bad design.
 * TODO: rewrite it in c++ code and encapsulate the functionality in a
@@ -42,4 +44,6 @@ struct android_log_transport_write {
    void (*noteDrop)(int error, int tag);
};

__END_DECLS

#endif  // ANDROID_STATS_LOG_STATS_WRITER_H