summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2015-01-15 17:16:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-15 17:16:01 +0000
commit6c555ea3058d957795c40bc07b264701427453a2 (patch)
treeda3be47cc812d3ea8041ce117d3890e1a8468ff3
parent1a65d5b3516ba5750e17b3cb5bc64a585b17f69a (diff)
parentd5b41767886de71e570edea98fd80228bb1211af (diff)
downloadsystem_core-6c555ea3058d957795c40bc07b264701427453a2.zip
system_core-6c555ea3058d957795c40bc07b264701427453a2.tar.gz
system_core-6c555ea3058d957795c40bc07b264701427453a2.tar.bz2
Merge "Return path including executable instead of without" into lmp-mr1-dev
-rw-r--r--adb/get_my_path_darwin.c10
-rw-r--r--fastboot/util_osx.c10
2 files changed, 10 insertions, 10 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);
}
diff --git a/fastboot/util_osx.c b/fastboot/util_osx.c
index e80a8f3..a8f5c31 100644
--- a/fastboot/util_osx.c
+++ b/fastboot/util_osx.c
@@ -32,12 +32,12 @@
void get_my_path(char s[PATH_MAX])
{
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, PATH_MAX - 1, kCFStringEncodingASCII);
- CFRelease(bundlePathString);
+ CFStringGetCString(executablePathString, s, PATH_MAX-1, kCFStringEncodingASCII);
+ CFRelease(executablePathString);
char *x;
x = strrchr(s, '/');