Merge branch 'maint'
[paraslash.git] / dccp_recv.c
index a0f8371efae6b0974a4f9c88ef1365b208a48eda..f71a7253a0296e8c0f849147287b5cede93233e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2010 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -105,10 +105,11 @@ err:
  */
 static bool dccp_recv_ccid_support_check(struct dccp_recv_args_info *conf)
 {
-       uint8_t ccids[DCCP_MAX_HOST_CCIDS];
-       uint8_t nccids = sizeof(ccids), i, j;
+       uint8_t *ccids;
+       int i, j, nccids;
 
-       if (dccp_available_ccids(ccids, &nccids) == NULL)
+       nccids = dccp_available_ccids(&ccids);
+       if (nccids <= 0)
                return false;
 
        for (i = 0; i < conf->ccid_given; i++) {
@@ -165,6 +166,9 @@ static void dccp_recv_post_select(struct sched *s, struct task *t)
        if (iovcnt == 0)
                goto err;
        ret = para_readv(pdd->fd, iov, iovcnt);
+       /* EAGAIN is possible even if FD_ISSET */
+       if (ret < 0 && is_errno(-ret, EAGAIN))
+               return;
        if (ret == 0)
                ret = -E_RECV_EOF;
        if (ret < 0)