Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2021-04-29 16:02:14 +0000
committerSravan Kumar Lakkimsetti2021-04-29 16:04:09 +0000
commitb350eec5ce7350eed34947e304f2cfec75f1827b (patch)
tree45c8aa73d69cd00e9990ef36223a7c3d334a2409
parent293e802a25e31461aed3213a6e437ad723d0f5c8 (diff)
downloadrt.equinox.framework-b350eec5ce7350eed34947e304f2cfec75f1827b.tar.gz
rt.equinox.framework-b350eec5ce7350eed34947e304f2cfec75f1827b.tar.xz
rt.equinox.framework-b350eec5ce7350eed34947e304f2cfec75f1827b.zip
Bug 573241 - [Mac] Eclipse launcher not able to find shared library
Change-Id: Ie57d6e39849a2924637cecdcd90532a8ca2fb2ce Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/179997
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c
index d13eebc0c..175f698ab 100644
--- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c
+++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoaCommon.c
@@ -147,11 +147,8 @@ char * resolveSymlinks( char * path ) {
char * result = 0;
CFURLRef url, resolved;
CFStringRef string;
- Boolean isStale;
- CFDataRef data;
- CFErrorRef errorRef;
-
-
+ FSRef fsRef;
+ Boolean isFolder, wasAliased;
if(path == NULL)
return path;
@@ -161,26 +158,24 @@ char * resolveSymlinks( char * path ) {
CFRelease(string);
if(url == NULL)
return path;
-
- data = CFURLCreateBookmarkDataFromFile(kCFAllocatorDefault, url, &errorRef);
- if (data == NULL) {
- CFRelease(url);
- return path;
- }
-
- resolved = CFURLCreateByResolvingBookmarkData(kCFAllocatorDefault, data, kCFURLBookmarkResolutionWithoutMountingMask|kCFURLBookmarkResolutionWithoutUIMask, NULL, NULL, &isStale, &errorRef);
- if(resolved != NULL) {
- string = CFURLCopyFileSystemPath(resolved, kCFURLPOSIXPathStyle);
- CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8);
- char *s = malloc(length);
- if (CFStringGetCString(string, s, length, kCFStringEncodingUTF8)) {
- result = s;
- } else {
- free(s);
- }
- CFRelease(string);
- CFRelease(resolved);
- }
+
+ if(CFURLGetFSRef(url, &fsRef)) {
+ if( FSResolveAliasFile(&fsRef, true, &isFolder, &wasAliased) == noErr) {
+ resolved = CFURLCreateFromFSRef(kCFAllocatorDefault, &fsRef);
+ if(resolved != NULL) {
+ string = CFURLCopyFileSystemPath(resolved, kCFURLPOSIXPathStyle);
+ CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8);
+ char *s = malloc(length);
+ if (CFStringGetCString(string, s, length, kCFStringEncodingUTF8)) {
+ result = s;
+ } else {
+ free(s);
+ }
+ CFRelease(string);
+ CFRelease(resolved);
+ }
+ }
+ }
CFRelease(url);
return result;
}

Back to the top