mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Noux: fix 'Vfs_io_channel::lseek()' calculations
With this patch the 'Vfs_io_channel::lseek()' function takes the offset argument into account when calculating the new seek offset in the SEEK_CUR and SEEK_END cases. Fixes #352.
This commit is contained in:
parent
4ab9782b8b
commit
4b81cf3e63
@ -157,8 +157,12 @@ namespace Noux {
|
||||
{
|
||||
switch (sysio->lseek_in.whence) {
|
||||
case Sysio::LSEEK_SET: _fh->_seek = sysio->lseek_in.offset; break;
|
||||
case Sysio::LSEEK_CUR: break;
|
||||
case Sysio::LSEEK_END: _fh->_seek = size(sysio); break;
|
||||
case Sysio::LSEEK_CUR: _fh->_seek += sysio->lseek_in.offset; break;
|
||||
case Sysio::LSEEK_END:
|
||||
off_t offset = sysio->lseek_in.offset;
|
||||
sysio->fstat_in.fd = sysio->lseek_in.fd;
|
||||
_fh->_seek = size(sysio) + offset;
|
||||
break;
|
||||
}
|
||||
sysio->lseek_out.offset = _fh->_seek;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user