Revert back to working code!

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32072 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-02-11 13:53:54 +00:00
parent f3f69cccc2
commit 336c7bf021
13 changed files with 57 additions and 71 deletions

View file

@ -3006,7 +3006,6 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
*/
- (id) initWithContentsOfMappedFile: (NSString*)path
{
off_t off;
int fd;
#if defined(__MINGW__)
@ -3034,15 +3033,14 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
return nil;
}
/* Find size of file to be mapped. */
off = lseek(fd, 0, SEEK_END);
if (off < 0)
length = lseek(fd, 0, SEEK_END);
if (length < 0)
{
NSWarnMLog(@"unable to seek to eof %@ - %@", path, [NSError _last]);
close(fd);
DESTROY(self);
return nil;
}
length = off;
/* Position at start of file. */
if (lseek(fd, 0, SEEK_SET) != 0)
{