Fail quietly when asked to read non-existent file

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40188 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2016-11-01 21:02:31 +00:00
parent ce18b5a8e5
commit 812cbbd80b

View file

@ -255,6 +255,11 @@ readContentsOfFile(NSString *path, void **buf, off_t *len, NSZone *zone)
}
att = [mgr fileAttributesAtPath: path traverseLink: YES];
if (nil == att)
{
return NO; // No such file ... fail quietly
}
if ([att fileType] != NSFileTypeRegular)
{
NSWarnFLog(@"Open (%@) attempt failed - not a regular file", path);