]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
dccp_send.c: Check the return value of mark_fd_nonblocking() also for the client fd.
authorAndre Noll <maan@systemlinux.org>
Sat, 19 Jan 2008 13:45:14 +0000 (14:45 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 19 Jan 2008 13:45:14 +0000 (14:45 +0100)
dccp_send.c

index 02e60f44c680a0406826a3439543b1b389bbb456..c9a03b94738848b94911cf7d7becea1227bd42b6 100644 (file)
@@ -82,13 +82,17 @@ static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds)
                PARA_ERROR_LOG("shutdown(SHUT_RD): %s\n", strerror(errno));
                goto err;
        }
+       ret = mark_fd_nonblocking(fd);
+       if (ret < 0) {
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+               goto err;
+       }
        dc = para_calloc(sizeof(struct dccp_client));
-       dc->fd = ret;
+       dc->fd = fd;
        dc->name = make_message("%s", remote_name(dc->fd));
        PARA_NOTICE_LOG("connection from %s\n", dc->name);
        para_list_add(&dc->node, &clients);
        add_close_on_fork_list(dc->fd);
-       mark_fd_nonblocking(dc->fd);
        dc->cq = cq_new(DCCP_MAX_PENDING_BYTES);
        return;
 err: