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

Commit 4bfbf2e4 authored by Steven Moreland's avatar Steven Moreland
Browse files

binderRpcTest: use TMPDIR

There was some discussion in review that my existing try and check
solution was messy. I'm not sure why I didn't use this.

Bug: 167966510
Test: run binderRpcTest on device & host
Change-Id: I594a410cf3712bcc22b9713fa3d82757e33f08d1
parent 6fde2dde
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -199,13 +199,8 @@ private:


static std::string allocateSocketAddress() {
static std::string allocateSocketAddress() {
    static size_t id = 0;
    static size_t id = 0;
    static bool gUseTmp = access("/tmp/", F_OK) != -1;
    std::string temp = getenv("TMPDIR") ?: "/tmp";

    return temp + "/binderRpcTest_" + std::to_string(id++);
    if (gUseTmp) {
        return "/tmp/binderRpcTest_" + std::to_string(id++);
    } else {
        return "/dev/binderRpcTest_" + std::to_string(id++);
    }
};
};


struct ProcessConnection {
struct ProcessConnection {