]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-temp.c
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8
[libucw.git] / lib / fb-temp.c
index 95edf16619020a3d282f6c12a04d5b5b640b3eb3..aff501e8d46966476b4e0a72f603153e0fac25d2 100644 (file)
@@ -1,7 +1,10 @@
 /*
 /*
- *     Sherlock Library -- Temporary Fastbufs
+ *     UCW Library -- Temporary Fastbufs
  *
  *
- *     (c) 2002 Martin Mares <mj@ucw.cz>
+ *     (c) 2002--2004 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #include "lib/lib.h"
  */
 
 #include "lib/lib.h"
@@ -25,14 +28,14 @@ static void CONSTRUCTOR temp_init_config(void)
 }
 
 struct fastbuf *
 }
 
 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++);
 {
   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);
-  f->is_temp_file = 1;
+  f = bopen(buf, O_RDWR | O_CREAT | O_TRUNC, buflen);
+  bconfig(f, BCONFIG_IS_TEMP_FILE, 1);
   return f;
 }
   return f;
 }