Skip to content

Commit 2cbdc9d

Browse files
committed
fix lseek() return mismatch
1 parent d03bcbd commit 2cbdc9d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 7.0.4
2+
- Fixed lseek() return mismatch
3+
14
Version 7.0.3
25
- Fixed .fpide search so file names are relative to the .fpide file
36
- Improved listing file tracking of COG pc (still buggy, but better)

include/libc/unix/posixio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,19 +393,19 @@ off_t lseek(int fd, off_t offset, int whence)
393393
off_t r;
394394

395395
if ((unsigned)fd >= (unsigned)_MAX_FILES) {
396-
return _seterror(EBADF);
396+
return (off_t)_seterror(EBADF);
397397
}
398398
f = &__filetab[fd];
399399
if (!f->lseek) {
400-
return _seterror(ENOSYS);
400+
return (off_t)_seterror(ENOSYS);
401401
}
402402
if (f->state & _VFS_STATE_APPEND) {
403403
// if we want to write again, make sure to seek to end of file
404404
f->state |= _VFS_STATE_NEEDSEEK;
405405
}
406406
r = (*f->lseek)(f, offset, whence);
407407
if (r < 0) {
408-
return _seterror(-(int)r);
408+
return (off_t)_seterror(-(int)r);
409409
}
410410
return r;
411411
}

0 commit comments

Comments
 (0)