From a5a5952c53839d6e56fa35265731fc7537d2bcb0 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 17 Feb 2004 02:36:57 +0000 Subject: [PATCH] use new lib_internal git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@915 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/vunify.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/util-vserver/src/vunify.c b/util-vserver/src/vunify.c index 769214a..e9c869e 100644 --- a/util-vserver/src/vunify.c +++ b/util-vserver/src/vunify.c @@ -23,6 +23,7 @@ #include "vunify.h" #include "util.h" +#include "lib_internal/unify.h" #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #define ENSC_WRAPPERS_IO 1 #define ENSC_WRAPPERS_FCNTL 1 @@ -61,6 +63,14 @@ static struct WalkdownInfo global_info; static struct SkipReason skip_reason; static struct Arguments const * global_args; +int Global_getVerbosity() { + return global_args->verbosity; +} + +bool Global_doRenew() { + return global_args->do_renew; +} + static void showHelp(int fd, char const *cmd, int res) { @@ -99,8 +109,6 @@ showVersion() exit(0); } -#include "vunify-compare.hc" - // Returns 'false' iff one of the files is not existing, or of the files are different/not unifyable static bool checkFstat(struct MatchList const * const mlist, @@ -136,8 +144,8 @@ checkFstat(struct MatchList const * const mlist, // both files are different, so return false skip_reason.r = rsDIFFERENT; - if ((!global_args->do_revert && !compareUnify (*dst_fstat, src_fstat)) || - ( global_args->do_revert && !compareDeUnify(*dst_fstat, src_fstat))) + if ((!global_args->do_revert && !Unify_isUnifyable(*dst_fstat, src_fstat)) || + ( global_args->do_revert && !Unify_isUnified (*dst_fstat, src_fstat))) return false; } @@ -184,7 +192,7 @@ checkDirEntry(PathInfo const *path, } else if (cache_stat!=0 && !global_args->do_revert && skip_reason.r == rsDIFFERENT && - compareDeUnify(cache_stat, src_stat)) { + Unify_isUnified(cache_stat, src_stat)) { skip_reason.r = rsUNIFIED; skip_reason.d.list = mlist; return 0; @@ -235,8 +243,6 @@ EsafeChdir(char const *path, struct stat const *exp_stat) FatalErrnoError(safeChdir(path, exp_stat)==-1, "safeChdir()"); } -#include "vunify-doit.hc" - static bool doit(struct MatchList const *mlist, PathInfo const *src_path, struct stat const *src_stat, @@ -265,8 +271,8 @@ doit(struct MatchList const *mlist, PathInfo_append(&path, src_path, path_buf); return (global_args->do_dry_run || - (!global_args->do_revert && doitUnify( path.d, src_stat, dst_path, dst_stat)) || - ( global_args->do_revert && doitDeUnify(path.d, src_stat, dst_path, dst_stat))); + (!global_args->do_revert && Unify_unify( path.d, src_stat, dst_path, dst_stat)) || + ( global_args->do_revert && Unify_deUnify(path.d, src_stat, dst_path, dst_stat))); } static void -- 1.8.1.5