]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/main-test.c
tableprinter: started fixing of setting cell values
[libucw.git] / ucw / main-test.c
index f349d4dfe0801cf8da1a4ac94a861a0a0401a2c8..8e9f376c78bcdccb70c39c327704df6fbb07bdec 100644 (file)
@@ -7,8 +7,8 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/mainloop.h"
+#include <ucw/lib.h>
+#include <ucw/mainloop.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -43,7 +43,18 @@ static void dread(struct main_block_io *bio)
 
 static void derror(struct main_block_io *bio, int cause)
 {
-  msg(L_INFO, "Error: %m !!! (cause %d)", cause);
+  switch (cause)
+    {
+    case BIO_ERR_READ:
+    case BIO_ERR_WRITE:
+      msg(L_INFO, "derror: %s error: %m", (cause == BIO_ERR_READ ? "read" : "write"));
+      break;
+    case BIO_ERR_TIMEOUT:
+      msg(L_INFO, "derror: Timeout");
+      break;
+    default:
+      ASSERT(0);
+    }
   bio->data = NULL;
   block_io_del(bio);
 }