mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 16:20:42 +00:00
Add diagnositcs for faulure to get executable pathhhhhhhhhhhhhhhhhhhhhhhhh
This commit is contained in:
parent
e231fe2067
commit
a75d1c7b18
2 changed files with 35 additions and 6 deletions
|
@ -358,6 +358,8 @@ GSPrivateExecutablePath()
|
||||||
[load_lock lock];
|
[load_lock lock];
|
||||||
if (beenHere == NO)
|
if (beenHere == NO)
|
||||||
{
|
{
|
||||||
|
NSString *tmp;
|
||||||
|
|
||||||
#if defined(PROCFS_EXE_LINK)
|
#if defined(PROCFS_EXE_LINK)
|
||||||
executablePath = [manager()
|
executablePath = [manager()
|
||||||
pathContentOfSymbolicLinkAtPath:
|
pathContentOfSymbolicLinkAtPath:
|
||||||
|
@ -376,19 +378,45 @@ GSPrivateExecutablePath()
|
||||||
executablePath = nil;
|
executablePath = nil;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (executablePath == nil || [executablePath length] == 0)
|
if ([executablePath length] == 0)
|
||||||
{
|
{
|
||||||
executablePath
|
executablePath
|
||||||
= [[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
|
= [[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
|
||||||
|
if ([executablePath length] == 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Unable to get executable path from NSProcessInfo.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (NO == [executablePath isAbsolutePath])
|
if (NO == [executablePath isAbsolutePath])
|
||||||
{
|
{
|
||||||
executablePath = AbsolutePathOfExecutable(executablePath, YES);
|
tmp = executablePath;
|
||||||
|
executablePath = AbsolutePathOfExecutable(tmp, YES);
|
||||||
|
if ([executablePath length] == 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Unable to get absolute value of executable path '%s'.\n",
|
||||||
|
[tmp UTF8String]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
executablePath = [executablePath stringByResolvingSymlinksInPath];
|
tmp = executablePath;
|
||||||
executablePath = [executablePath stringByStandardizingPath];
|
executablePath = [tmp stringByResolvingSymlinksInPath];
|
||||||
|
if ([executablePath length] == 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Unable to get resolve links in executable path '%s'.\n",
|
||||||
|
[tmp UTF8String]);
|
||||||
|
}
|
||||||
|
tmp = executablePath;
|
||||||
|
executablePath = [tmp stringByStandardizingPath];
|
||||||
|
if ([executablePath length] == 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Unable to standardize executable path '%s'.\n",
|
||||||
|
[tmp UTF8String]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
IF_NO_ARC([executablePath retain];)
|
IF_NO_ARC([executablePath retain];)
|
||||||
beenHere = YES;
|
beenHere = YES;
|
||||||
|
|
|
@ -2345,8 +2345,9 @@ GSPrivateDefaultsFlag(GSUserDefaultFlagType type)
|
||||||
{
|
{
|
||||||
if (initializing)
|
if (initializing)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "GSPrivateDefaultsFlag() called within"
|
fprintf(stderr, "GSPrivateDefaultsFlag(%d) called within"
|
||||||
" +[NSUserDefaults initialize] always returns NO.\n");
|
" +[NSUserDefaults initialize] always returns NO.\n",
|
||||||
|
(int)type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue