mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
f3f69cccc2
commit
336c7bf021
13 changed files with 57 additions and 71 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue