diff options
Diffstat (limited to 'fs/select.c')
-rw-r--r-- | fs/select.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/select.c b/fs/select.c index 41c3571e64ed..e2fd58f8f1db 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -586,7 +586,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list, | |||
586 | /* Optimise the no-wait case */ | 586 | /* Optimise the no-wait case */ |
587 | if (!(*timeout)) | 587 | if (!(*timeout)) |
588 | pt = NULL; | 588 | pt = NULL; |
589 | 589 | ||
590 | for (;;) { | 590 | for (;;) { |
591 | struct poll_list *walk; | 591 | struct poll_list *walk; |
592 | long __timeout; | 592 | long __timeout; |
@@ -616,10 +616,12 @@ static int do_poll(unsigned int nfds, struct poll_list *list, | |||
616 | * a poll_table to them on the next loop iteration. | 616 | * a poll_table to them on the next loop iteration. |
617 | */ | 617 | */ |
618 | pt = NULL; | 618 | pt = NULL; |
619 | if (count || !*timeout || signal_pending(current)) | 619 | if (!count) { |
620 | break; | 620 | count = wait->error; |
621 | count = wait->error; | 621 | if (signal_pending(current)) |
622 | if (count) | 622 | count = -EINTR; |
623 | } | ||
624 | if (count || !*timeout) | ||
623 | break; | 625 | break; |
624 | 626 | ||
625 | if (*timeout < 0) { | 627 | if (*timeout < 0) { |
@@ -689,8 +691,6 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout) | |||
689 | 691 | ||
690 | poll_initwait(&table); | 692 | poll_initwait(&table); |
691 | fdcount = do_poll(nfds, head, &table, timeout); | 693 | fdcount = do_poll(nfds, head, &table, timeout); |
692 | if (!fdcount && signal_pending(current)) | ||
693 | fdcount = -EINTR; | ||
694 | poll_freewait(&table); | 694 | poll_freewait(&table); |
695 | 695 | ||
696 | for (walk = head; walk; walk = walk->next) { | 696 | for (walk = head; walk; walk = walk->next) { |