Fix kernel leaking ESPIPE in non-error cases.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-09-23 22:55:13 +02:00
parent 933720e0b0
commit 73dc4a0feb
1 changed files with 2 additions and 0 deletions

View File

@ -149,9 +149,11 @@ bool Descriptor::IsSeekable()
if ( !checked_seekable )
{
// TODO: Is this enough? Check that errno happens to be ESPIPE?
int saved_errno = errno;
ioctx_t ctx; SetupKernelIOCtx(&ctx);
seekable = 0 <= vnode->lseek(&ctx, SEEK_SET, 0) || S_ISDIR(vnode->type);
checked_seekable = true;
errno = saved_errno;
}
return seekable;
}