diff options
| -rw-r--r-- | libs/binder/tests/binderRpcTest.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp index a51c98774e..33402937ab 100644 --- a/libs/binder/tests/binderRpcTest.cpp +++ b/libs/binder/tests/binderRpcTest.cpp @@ -199,13 +199,8 @@ private: static std::string allocateSocketAddress() { static size_t id = 0; - static bool gUseTmp = access("/tmp/", F_OK) != -1; - - if (gUseTmp) { - return "/tmp/binderRpcTest_" + std::to_string(id++); - } else { - return "/dev/binderRpcTest_" + std::to_string(id++); - } + std::string temp = getenv("TMPDIR") ?: "/tmp"; + return temp + "/binderRpcTest_" + std::to_string(id++); }; struct ProcessConnection { |