From: Martin Mares Date: Sat, 25 Aug 2007 11:38:23 +0000 (+0200) Subject: Use bfix_tmp_file() whereever possible. X-Git-Tag: holmes-import~506^2~13^2~85 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7f378422fa31037ceaee65476a7628b5b891c2d4;p=libucw.git Use bfix_tmp_file() whereever possible. --- diff --git a/lib/sorter.h b/lib/sorter.h index eebd2206..4cc8c995 100644 --- a/lib/sorter.h +++ b/lib/sorter.h @@ -538,10 +538,7 @@ struct fastbuf *fb1, struct fastbuf *fb2 #ifdef SORT_OUTPUT_FB return fb1; #else - bconfig(fb1, BCONFIG_IS_TEMP_FILE, 0); - if (rename(fb1->name, outname) < 0) - die("rename(%s,%s): %m", fb1->name, outname); - bclose(fb1); + bfix_tmp_file(fb1, outname); #endif } diff --git a/lib/sorter/sorter.h b/lib/sorter/sorter.h index d17f4197..e329fa29 100644 --- a/lib/sorter/sorter.h +++ b/lib/sorter/sorter.h @@ -272,10 +272,7 @@ static struct fastbuf *P(sort)( sorter_run(&ctx); #ifdef SORT_OUTPUT_FILE - if (rename(ctx.out_fb->name, out) < 0) - die("Cannot rename %s to %s: %m", ctx.out_fb->name, out); - bconfig(ctx.out_fb, BCONFIG_IS_TEMP_FILE, 0); - bclose(ctx.out_fb); + bfix_tmp_file(ctx.out_fb, out); ctx.out_fb = NULL; #endif return ctx.out_fb;