]> git.imager.perl.org - imager.git/commitdiff
more i_fatal
authorTony Cook <tony@develop-help.com>
Mon, 13 Aug 2012 08:18:17 +0000 (18:18 +1000)
committerTony Cook <tony@develop-help.com>
Sat, 24 Nov 2012 03:59:24 +0000 (14:59 +1100)
iolayer.c

index 28b5bdc601048640a8a7400e0ca8196bddae4178..18a78058c0482f9071aa84bf751e531805ee0f0f 100644 (file)
--- a/iolayer.c
+++ b/iolayer.c
@@ -369,7 +369,8 @@ io_slurp(io_glue *ig, unsigned char **c) {
   io_type inn = ig->type;
   
   if ( inn != BUFCHAIN ) {
   io_type inn = ig->type;
   
   if ( inn != BUFCHAIN ) {
-    i_fatal(0, "io_slurp: called on a source that is not from a bufchain\n");
+    dIMCTXio(ig);
+    im_fatal(aIMCTX, 0, "io_slurp: called on a source that is not from a bufchain\n");
   }
 
   ieb = ig->exdata;
   }
 
   ieb = ig->exdata;
@@ -381,8 +382,10 @@ io_slurp(io_glue *ig, unsigned char **c) {
   
   rc = bufchain_read(ig, cc, ieb->length);
 
   
   rc = bufchain_read(ig, cc, ieb->length);
 
-  if (rc != ieb->length)
-    i_fatal(1, "io_slurp: bufchain_read returned an incomplete read: rc = %d, request was %d\n", rc, ieb->length);
+  if (rc != ieb->length) {
+    dIMCTXio(ig);
+    im_fatal(aIMCTX,1, "io_slurp: bufchain_read returned an incomplete read: rc = %d, request was %d\n", rc, ieb->length);
+  }
 
   return rc;
 }
 
   return rc;
 }
@@ -1886,7 +1889,7 @@ bufchain_seek(io_glue *ig, off_t offset, int whence) {
       ssize_t rc, wl = i_min(wrlen, BBSIZ);
       im_log((aIMCTX, 1, "bufchain_seek: wrlen = %d, wl = %ld\n", wrlen, (long)wl));
       rc = bufchain_write( ig, TB, wl );
       ssize_t rc, wl = i_min(wrlen, BBSIZ);
       im_log((aIMCTX, 1, "bufchain_seek: wrlen = %d, wl = %ld\n", wrlen, (long)wl));
       rc = bufchain_write( ig, TB, wl );
-      if (rc != wl) i_fatal(0, "bufchain_seek: Unable to extend file\n");
+      if (rc != wl) im_fatal(aIMCTX, 0, "bufchain_seek: Unable to extend file\n");
       wrlen -= rc;
     }
   }
       wrlen -= rc;
     }
   }