summaryrefslogtreecommitdiffstats
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-08-31 15:07:18 -0700
committerElliott Hughes <enh@google.com>2016-09-01 09:24:24 -0700
commit82ff315bb0fecb9127970e01b399be53c92ca14f (patch)
tree194dfb8de311f236afdeebce4a5933e4a99cef6b /fastboot/fastboot.cpp
parent6a5ed849e832aac7da24fca5b7cf01d7c052f56e (diff)
downloadsystem_core-82ff315bb0fecb9127970e01b399be53c92ca14f.tar.gz
system_core-82ff315bb0fecb9127970e01b399be53c92ca14f.tar.bz2
system_core-82ff315bb0fecb9127970e01b399be53c92ca14f.zip
Add android::base::GetExecutablePath, switch adb and fastboot over.
We'd long had two copies of this stuff, so rather than rewrite both Linux versions to use android::base::Readlink, let's kill the duplication too... Bug: http://b/30988271 Change-Id: I4de58a94a22a4b1faf969a6fc70ca1560a4d5121
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index df0f6516e..987ba8356 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -47,6 +47,7 @@
#include <utility>
#include <vector>
+#include <android-base/file.h>
#include <android-base/macros.h>
#include <android-base/parseint.h>
#include <android-base/parsenetaddress.h>
@@ -116,7 +117,7 @@ static struct {
static std::string find_item_given_name(const char* img_name, const char* product) {
if(product) {
- std::string path = get_my_path();
+ std::string path = android::base::GetExecutablePath();
path.erase(path.find_last_of('/'));
return android::base::StringPrintf("%s/../../../target/product/%s/%s",
path.c_str(), product, img_name);