diff options
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/capi/capi.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index f8f86602c57e..8abec9655e1a 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -657,24 +657,19 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
657 | struct capidev *cdev = (struct capidev *)file->private_data; | 657 | struct capidev *cdev = (struct capidev *)file->private_data; |
658 | struct sk_buff *skb; | 658 | struct sk_buff *skb; |
659 | size_t copied; | 659 | size_t copied; |
660 | int err; | ||
660 | 661 | ||
661 | if (!cdev->ap.applid) | 662 | if (!cdev->ap.applid) |
662 | return -ENODEV; | 663 | return -ENODEV; |
663 | 664 | ||
664 | if ((skb = skb_dequeue(&cdev->recvqueue)) == NULL) { | 665 | skb = skb_dequeue(&cdev->recvqueue); |
665 | 666 | if (!skb) { | |
666 | if (file->f_flags & O_NONBLOCK) | 667 | if (file->f_flags & O_NONBLOCK) |
667 | return -EAGAIN; | 668 | return -EAGAIN; |
668 | 669 | err = wait_event_interruptible(cdev->recvwait, | |
669 | for (;;) { | 670 | (skb = skb_dequeue(&cdev->recvqueue))); |
670 | interruptible_sleep_on(&cdev->recvwait); | 671 | if (err) |
671 | if ((skb = skb_dequeue(&cdev->recvqueue)) != NULL) | 672 | return err; |
672 | break; | ||
673 | if (signal_pending(current)) | ||
674 | break; | ||
675 | } | ||
676 | if (skb == NULL) | ||
677 | return -ERESTARTNOHAND; | ||
678 | } | 673 | } |
679 | if (skb->len > count) { | 674 | if (skb->len > count) { |
680 | skb_queue_head(&cdev->recvqueue, skb); | 675 | skb_queue_head(&cdev->recvqueue, skb); |