src/line_proto.c
changeset 22 c339c020fd33
parent 21 0911d0b828d4
child 27 e6639132bead
--- a/src/line_proto.c	Sun Mar 01 01:48:14 2009 +0200
+++ b/src/line_proto.c	Sun Mar 01 02:02:48 2009 +0200
@@ -1,12 +1,11 @@
 
 #include "line_proto.h"
+#include "log.h"
 
 #include <string.h>
 #include <stdlib.h>
 #include <assert.h>
 
-#include <err.h>
-
 /*
  * Our state
  */
@@ -54,8 +53,8 @@
     do {
         // attempt to read a line
         if (line_proto_recv(lp, &line))
-            // XXX: fail
-            errx(1, "line_proto_recv: %s", error_msg(&lp->err));
+            // XXX: un-fatalize
+            FATAL_ERROR(&lp->err, "line_proto_recv");
         
         // got a line?
         if (line)
@@ -65,7 +64,7 @@
 
     // reschedule
     if (line_proto_schedule_events(lp, EV_READ))
-        errx(1, "line_proto_schedule_events: %s", error_msg(&lp->err));
+        FATAL_ERROR(&lp->err, "line_proto_schedule_events");
 }
 
 /*
@@ -78,7 +77,7 @@
 
     // just flush
     if ((err = line_proto_flush(lp)) < 0)
-        errx(1, "line_proto_flush: %s", error_name(err));
+        FATAL_ERR(err, "line_proto_flush");
 }
 
 /*