Commit 87ba81dba431232548ce29d5d224115d0c2355ac

Authored by Valentine Barshak
Committed by Linus Torvalds
1 parent 99aef427e2

[PATCH] fadvise: return ESPIPE on FIFO/pipe

The patch makes posix_fadvise return ESPIPE on FIFO/pipe in order to be
fully POSIX-compliant.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

... ... @@ -37,6 +37,11 @@
37 37 if (!file)
38 38 return -EBADF;
39 39  
  40 + if (S_ISFIFO(file->f_dentry->d_inode->i_mode)) {
  41 + ret = -ESPIPE;
  42 + goto out;
  43 + }
  44 +
40 45 mapping = file->f_mapping;
41 46 if (!mapping || len < 0) {
42 47 ret = -EINVAL;