string: Clean up for_each_line() and related functions.
[paraslash.git] / udp_recv.c
index c1f238308b58bab556434f57171be30db92944f2..6c5ee0261d78a6dbfb9c903e388c6d488b228694 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2012 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 #include "list.h"
 #include "sched.h"
 #include "ggo.h"
+#include "buffer_tree.h"
 #include "recv.h"
 #include "udp_recv.cmdline.h"
 #include "string.h"
 #include "net.h"
 #include "fd.h"
-#include "buffer_tree.h"
 
 static void udp_recv_pre_select(struct sched *s, struct task *t)
 {
@@ -57,7 +57,9 @@ static void udp_recv_post_select(__a_unused struct sched *s, struct task *t)
        struct iovec iov[2];
        int ret, readv_ret, iovcnt;
 
-       t->error = 0;
+       ret = task_get_notification(t);
+       if (ret < 0)
+               goto out;
        ret = btr_node_status(btrn, 0, BTR_NT_ROOT);
        if (ret <= 0)
                goto out;
@@ -83,7 +85,7 @@ static void udp_recv_post_select(__a_unused struct sched *s, struct task *t)
 out:
        if (ret >= 0)
                return;
-       btr_remove_node(btrn);
+       btr_remove_node(&rn->btrn);
        t->error = ret;
        close(rn->fd);
        rn->fd = -1;