use $(LIBENSCVECTOR) instead of libensc_vector.a
[util-vserver.git] / util-vserver / src / vunify.c
index 4dd8edf..0c98af4 100644 (file)
@@ -131,26 +131,25 @@ checkFstat(struct MatchList const * const mlist,
   }
 
   assert(*dst_fstat!=0);
+
   
-  {
-    PathInfo           src_path = mlist->root;
-    char               src_path_buf[ENSC_PI_APPSZ(src_path, *path)];
+  PathInfo     src_path = mlist->root;
+  char         src_path_buf[ENSC_PI_APPSZ(src_path, *path)];
 
-    PathInfo_append(&src_path, path, src_path_buf);
+  PathInfo_append(&src_path, path, src_path_buf);
 
     // source file does not exist
-    skip_reason.r = rsNOEXISTS;
-    if (lstat(src_path.d, src_fstat)==-1) return false;
+  skip_reason.r = rsNOEXISTS;
+  if (lstat(src_path.d, src_fstat)==-1) return false;
 
     // these are directories; this succeeds everytime
-    if (S_ISDIR((*dst_fstat)->st_mode) && S_ISDIR(src_fstat->st_mode)) return true;
+  if (S_ISDIR((*dst_fstat)->st_mode) && S_ISDIR(src_fstat->st_mode)) return true;
 
     // both files are different, so return false
-    skip_reason.r = rsDIFFERENT;
-    if ((!global_args->do_revert && !Unify_isUnifyable(*dst_fstat, src_fstat)) ||
-       ( global_args->do_revert && !Unify_isUnified  (*dst_fstat, src_fstat)))
-      return false;
-  }
+  skip_reason.r = rsDIFFERENT;
+  if ((!global_args->do_revert && !Unify_isUnifyable(*dst_fstat, src_fstat)) ||
+      ( global_args->do_revert && !Unify_isUnified  (*dst_fstat, src_fstat)))
+    return false;
 
   // these are the same files
   return true;
@@ -252,15 +251,15 @@ doit(struct MatchList const *mlist,
     if (global_args->do_revert) WRITE_MSG(1, "deunifying '");
     else                        WRITE_MSG(1, "unifying   '");
 
-    write(1, src_path->d, src_path->l);
+    Vwrite(1, src_path->d, src_path->l);
     WRITE_MSG(1, "'");
 
     if (Global_getVerbosity()>=4) {
       WRITE_MSG(1, " (from ");
       if (Global_getVerbosity()==4 && mlist->id.d)
-       write(1, mlist->id.d, mlist->id.l);
+       Vwrite(1, mlist->id.d, mlist->id.l);
       else
-       write(1, mlist->root.d, mlist->root.l);
+       Vwrite(1, mlist->root.d, mlist->root.l);
       WRITE_MSG(1, ")");
     }
     WRITE_MSG(1, "\n");
@@ -268,7 +267,7 @@ doit(struct MatchList const *mlist,
   
   PathInfo_append(&path, src_path, path_buf);
   return (global_args->do_dry_run ||
-         (!global_args->do_revert && Unify_unify  (path.d, src_stat, dst_path)) ||
+         (!global_args->do_revert && Unify_unify  (path.d, src_stat, dst_path, false)) ||
          ( global_args->do_revert && Unify_deUnify(dst_path)));
 }
 
@@ -285,7 +284,7 @@ printSkipReason()
       MatchList_printId(skip_reason.d.list, 1);
       break;
     case rsFSTAT       :  WRITE_MSG(1, "fstat error"); break;
-    case rsNOEXISTS    :  WRITE_MSG(1, "does not exists in refserver(s)"); break;
+    case rsNOEXISTS    :  WRITE_MSG(1, "does not exist in refserver(s)"); break;
     case rsSYMLINK     :  WRITE_MSG(1, "symlink"); break;
     case rsSPECIAL     :  WRITE_MSG(1, "non regular file"); break;
     case rsUNIFIED     :  WRITE_MSG(1, "already unified"); break;
@@ -329,7 +328,7 @@ visitDirEntry(struct dirent const *ent)
         (Global_getVerbosity()>=6 && is_dotfile) ||
         (Global_getVerbosity()>=6 && is_link)) ) {
       WRITE_MSG(1, "  skipping '");
-      write(1, path.d, path.l);
+      Vwrite(1, path.d, path.l);
       WRITE_MSG(1, "'");
       if (Global_getVerbosity()>=2) printSkipReason();
       WRITE_MSG(1, "\n");