X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvunify.c;h=0c98af41251558058ac57c707c63b3f37a5d4da8;hb=5b39edfee423f5f3cbe8fa223dcfdc9e8d66e286;hp=4d8d411f0a4be7070d692a00d00a6332e2067aa3;hpb=4bdcb4c266a7e84215692c17111eca5806e95a64;p=util-vserver.git diff --git a/util-vserver/src/vunify.c b/util-vserver/src/vunify.c index 4d8d411..0c98af4 100644 --- a/util-vserver/src/vunify.c +++ b/util-vserver/src/vunify.c @@ -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))); } @@ -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");