renamed to -compat.c
[util-vserver.git] / util-vserver / src / fstool.c
index 9b750a5..d732bc3 100644 (file)
 
 #include "fstool.h"
 #include "util.h"
-#include "wrappers.h"
-#include "wrappers-dirent.h"
 
 #include <lib/vserver.h>
 
 #include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
 
+#define ENSC_WRAPPERS_DIRENT   1
+#define ENSC_WRAPPERS_FCNTL    1
+#define ENSC_WRAPPERS_UNISTD   1
+#include <wrappers.h>
 
 struct Arguments const *               global_args = 0;
 
@@ -90,7 +96,7 @@ iterateFilesystem(char const *path)
 
   // show current directory entry first
   if (lstat(".", &cur_st)==-1) perror("lstat()");
-  else err += handleFile(".", path, &cur_st) ? 0 : 1;
+  else err += handleFile(".", path) ? 0 : 1;
 
   // strip trailing '/'
   while (path_len>0 && path[path_len-1]=='/') --path_len;
@@ -116,7 +122,7 @@ iterateFilesystem(char const *path)
     
     {
       CONCAT_PATHS(path, path_len, ent->d_name);
-      err += handleFile(ent->d_name, new_path, &st) ? 0 : 1;
+      err += handleFile(ent->d_name, new_path) ? 0 : 1;
     }
   }
 
@@ -177,7 +183,7 @@ processFile(char const *path)
     return iterateFilesystem(path);
   }
   else
-    return handleFile(path, path, &st);
+    return handleFile(path, path) ? 0 : 1;
 }
 
 int main(int argc, char *argv[])