]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fb-temp.c
Documented ucw/string.h.
[libucw.git] / ucw / fb-temp.c
index f3c574b6bb047d57851e26747dc2dac11722bd85..a68eb5824d86cfd11c4a3151c0962896de793314 100644 (file)
@@ -35,7 +35,7 @@ void bfix_tmp_file(struct fastbuf *fb, const char *name)
   int was_temp = bconfig(fb, BCONFIG_IS_TEMP_FILE, 0);
   ASSERT(was_temp == 1);
   if (rename(fb->name, name))
   int was_temp = bconfig(fb, BCONFIG_IS_TEMP_FILE, 0);
   ASSERT(was_temp == 1);
   if (rename(fb->name, name))
-    die("Cannot rename %s to %s: %m", fb->name, name);
+    bthrow(fb, "fb.tmp", "Cannot rename %s to %s: %m", fb->name, name);
   bclose(fb);
 }
 
   bclose(fb);
 }
 
@@ -50,6 +50,7 @@ int main(int argc, char **argv)
     die("Hey, whaddya want?");
 
   struct fastbuf *f = bopen_tmp(65536);
     die("Hey, whaddya want?");
 
   struct fastbuf *f = bopen_tmp(65536);
+  ASSERT(f && f->name);
   bputsn(f, "Hello, world!");
   bclose(f);
   return 0;
   bputsn(f, "Hello, world!");
   bclose(f);
   return 0;