crypt_common.c: Add missing doxygen documentation.
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index 424286b5a4c21613517d632777d3052578e869fd..6b574414b6b13c227c98b008addd28f4b2302b33 100644 (file)
--- a/write.c
+++ b/write.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2010 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2011 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -8,7 +8,6 @@
 
 #include <regex.h>
 #include <sys/types.h>
-#include <dirent.h>
 #include <stdbool.h>
 
 #include "para.h"
@@ -23,6 +22,7 @@
 #include "write_common.h"
 #include "fd.h"
 #include "error.h"
+#include "version.h"
 
 INIT_WRITE_ERRLISTS;
 
@@ -209,6 +209,20 @@ static int main_btr(struct sched *s)
        s->default_timeout.tv_sec = 10;
        s->default_timeout.tv_usec = 50000;
        ret = schedule(s);
+       if (ret >= 0) {
+               int j;
+               for (j = 0; j < i; j++) {
+                       struct task *t = &wns[j].task;
+                       assert(t->error < 0);
+                       if (t->error != -E_WRITE_COMMON_EOF
+                                       && t->error != -E_BTR_EOF) {
+                               PARA_ERROR_LOG("%s: %s\n", t->status,
+                                       para_strerror(-t->error));
+                               if (ret >= 0)
+                                       ret = t->error;
+                       }
+               }
+       }
 out:
        for (i--; i >= 0; i--) {
                struct writer_node *wn = wns + i;
@@ -216,6 +230,7 @@ out:
 
                w->close(wn);
                btr_free_node(wn->btrn);
+               w->free_config(wn->conf);
                free(wn->conf);
        }
        free(wns);