]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-file.c
added declaration and initialization of sections
[libucw.git] / lib / fb-file.c
index 915c1b40f78018ff4478eae894af59d487ca9fd7..9caf9a189aaf45c33a2b7f83dc6381ab45bac0c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Sherlock Library -- Fast Buffered I/O on Files
+ *     UCW Library -- Fast Buffered I/O on Files
  *
  *     (c) 1997--2004 Martin Mares <mj@ucw.cz>
  *
@@ -11,7 +11,6 @@
 #include "lib/fastbuf.h"
 #include "lib/lfs.h"
 
-#include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -153,6 +152,14 @@ bfdopen_shared(int fd, uns buflen)
   return f;
 }
 
+void
+bfilesync(struct fastbuf *b)
+{
+  bflush(b);
+  if (fsync(FB_FILE(b)->fd) < 0)
+    log(L_ERROR, "fsync(%s) failed: %m", b->name);
+}
+
 #ifdef TEST
 
 int main(int argc, char **argv)