]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-mmap.c
Implemented bfix_tmp_file(), which turns a temporary file fastbuf
[libucw.git] / lib / fb-mmap.c
index 15c542a07082bbc0f1a0f4d23d9d334596b9d461..56c2ef666504d2abfac52832e62d16d697885dd8 100644 (file)
@@ -146,7 +146,7 @@ bfmm_close(struct fastbuf *f)
     {
     case 1:
       if (unlink(f->name) < 0)
-       log(L_ERROR, "unlink(%s): %m", f->name);
+       msg(L_ERROR, "unlink(%s): %m", f->name);
     case 0:
       if (close(F->fd))
        die("close(%s): %m", f->name);
@@ -157,18 +157,21 @@ bfmm_close(struct fastbuf *f)
 static int
 bfmm_config(struct fastbuf *f, uns item, int value)
 {
+  int orig;
+
   switch (item)
     {
     case BCONFIG_IS_TEMP_FILE:
+      orig = FB_MMAP(f)->is_temp_file;
       FB_MMAP(f)->is_temp_file = value;
-      return 0;
+      return orig;
     default:
       return -1;
     }
 }
 
 struct fastbuf *
-bfmmopen_internal(int fd, byte *name, uns mode)
+bfmmopen_internal(int fd, const char *name, uns mode)
 {
   int namelen = strlen(name) + 1;
   struct fb_mmap *F = xmalloc(sizeof(struct fb_mmap) + namelen);