mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
seek(2) now correctly rejects a bad whence value.
This commit is contained in:
parent
6367a2352e
commit
36ff6c7f96
1 changed files with 1 additions and 1 deletions
|
@ -146,7 +146,7 @@ namespace Sortix
|
|||
case SEEK_SET: origin = 0; break;
|
||||
case SEEK_CUR: origin = buffer->Position(); break;
|
||||
case SEEK_END: origin = buffer->Size(); break;
|
||||
default: Error::Set(EINVAL); *offset = -1; break;
|
||||
default: Error::Set(EINVAL); *offset = -1; return;
|
||||
}
|
||||
off_t newposition = origin + *offset;
|
||||
if ( newposition < 0 ) { Error::Set(EINVAL); *offset = -1; return; }
|
||||
|
|
Loading…
Reference in a new issue