diff options
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -415,6 +415,10 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
415 | 415 | ||
416 | if (filp->f_mode & FMODE_WRITE) { | 416 | if (filp->f_mode & FMODE_WRITE) { |
417 | mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; | 417 | mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; |
418 | /* | ||
419 | * Most Unices do not set POLLERR for FIFOs but on Linux they | ||
420 | * behave exactly like pipes for poll(). | ||
421 | */ | ||
418 | if (!PIPE_READERS(*inode)) | 422 | if (!PIPE_READERS(*inode)) |
419 | mask |= POLLERR; | 423 | mask |= POLLERR; |
420 | } | 424 | } |
@@ -422,9 +426,6 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
422 | return mask; | 426 | return mask; |
423 | } | 427 | } |
424 | 428 | ||
425 | /* FIXME: most Unices do not set POLLERR for fifos */ | ||
426 | #define fifo_poll pipe_poll | ||
427 | |||
428 | static int | 429 | static int |
429 | pipe_release(struct inode *inode, int decr, int decw) | 430 | pipe_release(struct inode *inode, int decr, int decw) |
430 | { | 431 | { |
@@ -568,7 +569,7 @@ struct file_operations read_fifo_fops = { | |||
568 | .read = pipe_read, | 569 | .read = pipe_read, |
569 | .readv = pipe_readv, | 570 | .readv = pipe_readv, |
570 | .write = bad_pipe_w, | 571 | .write = bad_pipe_w, |
571 | .poll = fifo_poll, | 572 | .poll = pipe_poll, |
572 | .ioctl = pipe_ioctl, | 573 | .ioctl = pipe_ioctl, |
573 | .open = pipe_read_open, | 574 | .open = pipe_read_open, |
574 | .release = pipe_read_release, | 575 | .release = pipe_read_release, |
@@ -580,7 +581,7 @@ struct file_operations write_fifo_fops = { | |||
580 | .read = bad_pipe_r, | 581 | .read = bad_pipe_r, |
581 | .write = pipe_write, | 582 | .write = pipe_write, |
582 | .writev = pipe_writev, | 583 | .writev = pipe_writev, |
583 | .poll = fifo_poll, | 584 | .poll = pipe_poll, |
584 | .ioctl = pipe_ioctl, | 585 | .ioctl = pipe_ioctl, |
585 | .open = pipe_write_open, | 586 | .open = pipe_write_open, |
586 | .release = pipe_write_release, | 587 | .release = pipe_write_release, |
@@ -593,7 +594,7 @@ struct file_operations rdwr_fifo_fops = { | |||
593 | .readv = pipe_readv, | 594 | .readv = pipe_readv, |
594 | .write = pipe_write, | 595 | .write = pipe_write, |
595 | .writev = pipe_writev, | 596 | .writev = pipe_writev, |
596 | .poll = fifo_poll, | 597 | .poll = pipe_poll, |
597 | .ioctl = pipe_ioctl, | 598 | .ioctl = pipe_ioctl, |
598 | .open = pipe_rdwr_open, | 599 | .open = pipe_rdwr_open, |
599 | .release = pipe_rdwr_release, | 600 | .release = pipe_rdwr_release, |