lkml.org 
[lkml]   [2014]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vfs: respect FMODE_UNSIGNED_OFFSET in p(read|write)[v]*().
On Wed, Jan 29, 2014 at 11:57:20AM +0000, Nick Alcock wrote:
> ssize_t ret = -EBADF;
>
> - if (pos < 0)
> + f = fdget(fd);
> + if ((pos < 0) && (!f.file || !unsigned_offsets(f.file))) {
> + fdput(f);
> return -EINVAL;
> + }

... and now pread(-1, ...) fails with EINVAL instead of EBADF.


\
 
 \ /
  Last update: 2014-01-29 16:41    [W:0.033 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site