summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorAl Sutton <al@funkyandroid.com>2014-11-20 13:33:57 +0000
committerAl Sutton <al@funkyandroid.com>2014-11-20 13:33:57 +0000
commit26b53bb75e6bdf9aa7820a3343845dae145625cc (patch)
tree55944dea5b2107b3ff8820dae423fcbc9498ab48 /adb
parent46ee85fcc301471aff9d95a817599349570dcef8 (diff)
downloadsystem_core-26b53bb75e6bdf9aa7820a3343845dae145625cc.zip
system_core-26b53bb75e6bdf9aa7820a3343845dae145625cc.tar.gz
system_core-26b53bb75e6bdf9aa7820a3343845dae145625cc.tar.bz2
Return path including executable instead of without
The previous implementation returned the path the executable was in instead of returning the path including the executable (i.e. it returned ...bin instead of ...bin/executable). This is not what the original methods did and caused the process forking of adb to fail. This patch corrects the implementation. Change-Id: Ib58497cab35706041f170c1bc97c31fd5d965f90
Diffstat (limited to 'adb')
-rw-r--r--adb/get_my_path_darwin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/adb/get_my_path_darwin.c b/adb/get_my_path_darwin.c
index 9141b57..65dd226 100644
--- a/adb/get_my_path_darwin.c
+++ b/adb/get_my_path_darwin.c
@@ -20,11 +20,11 @@
void get_my_path(char *s, size_t maxLen)
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
- CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
- CFStringRef bundlePathString = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
- CFRelease(bundleURL);
+ CFURLRef executableURL = CFBundleCopyExecutableURL(mainBundle);
+ CFStringRef executablePathString = CFURLCopyFileSystemPath(executableURL, kCFURLPOSIXPathStyle);
+ CFRelease(executableURL);
- CFStringGetCString(bundlePathString, s, maxLen, kCFStringEncodingASCII);
- CFRelease(bundlePathString);
+ CFStringGetCString(executablePathString, s, maxLen, kCFStringEncodingASCII);
+ CFRelease(executablePathString);
}