]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sync.c
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#dev-sorter
[libucw.git] / lib / sync.c
index 76bd590129bf50d07618d583291d8b99a727316b..6341415a3c94660799725836c4a3a71ea2dbf658 100644 (file)
@@ -1,7 +1,7 @@
 /*
- *     Sherlock Library -- Syncing Directories
+ *     UCW Library -- Syncing Directories
  *
- *     (c) 2004 Martin Mares <mj@ucw.cz>
+ *     (c) 2004--2005 Martin Mares <mj@ucw.cz>
  */
 
 #include "lib/lib.h"
 #include <unistd.h>
 
 void
-sync_dir(byte *name)
+sync_dir(const char *name)
 {
-  int fd = open(name, O_RDONLY | O_DIRECTORY);
+  int fd = open(name, O_RDONLY
+#ifdef CONFIG_LINUX
+               | O_DIRECTORY
+#endif
+);
   if (fd < 0)
     goto err;
   int err = fsync(fd);
@@ -20,5 +24,5 @@ sync_dir(byte *name)
   if (err >= 0)
     return;
  err:
-  log(L_ERROR, "Unable to sync directory %s: %m", name);
+  msg(L_ERROR, "Unable to sync directory %s: %m", name);
 }