X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffb-temp.c;h=aff501e8d46966476b4e0a72f603153e0fac25d2;hb=396571ed89ec4260ba3fd1b7ce2b38b07bd90ab7;hp=c6daec31bbbbb73ac8eba3654c090fc41d61ad4c;hpb=cf83e06e4158617e981fef5bf3878315b23bf7f9;p=libucw.git diff --git a/lib/fb-temp.c b/lib/fb-temp.c index c6daec31..aff501e8 100644 --- a/lib/fb-temp.c +++ b/lib/fb-temp.c @@ -1,7 +1,7 @@ /* - * Sherlock Library -- Temporary Fastbufs + * UCW Library -- Temporary Fastbufs * - * (c) 2002 Martin Mares + * (c) 2002--2004 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -28,14 +28,14 @@ static void CONSTRUCTOR temp_init_config(void) } struct fastbuf * -bopen_tmp(uns bufsize) +bopen_tmp(uns buflen) { byte buf[256]; struct fastbuf *f; static uns temp_counter; sprintf(buf, temp_template, (int) getpid(), temp_counter++); - f = bopen(buf, O_RDWR | O_CREAT | O_EXCL, bufsize); - FB_IS_TEMP_FILE(f) = 1; + f = bopen(buf, O_RDWR | O_CREAT | O_TRUNC, buflen); + bconfig(f, BCONFIG_IS_TEMP_FILE, 1); return f; }