From: Enrico Scholz Date: Sat, 17 Jan 2004 05:24:19 +0000 (+0000) Subject: moved init*() functions to vunify-init.c X-Git-Tag: VERSION_0_10~892 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e712eaebbd8490716f7ab6118beff7857147c0b4;p=util-vserver.git moved init*() functions to vunify-init.c git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@635 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/src/vunify.c b/util-vserver/src/vunify.c index 7630329..d0bc7c0 100644 --- a/util-vserver/src/vunify.c +++ b/util-vserver/src/vunify.c @@ -324,91 +324,6 @@ visitDir(char const *name, struct stat const *expected_stat) #include "vunify-init.ic" -static void -initModeManually(struct Arguments const UNUSED *args, int argc, char *argv[]) -{ - int i, count=argc/2; - - if (argc%2) { - WRITE_MSG(2, "Odd number of (path,excludelist) arguments\n"); - exit(1); - } - - if (count<2) { - WRITE_MSG(2, "No reference path(s) given\n"); - exit(1); - } - - initMatchList(&global_info.dst_list, 0, argv[0], argv[1]); - - --count; - global_info.src_lists.v = Emalloc(sizeof(struct MatchList) * count); - global_info.src_lists.l = count; - - for (i=0; id_name, "refserver.", 10)==0; -} - -static void -initModeVserver(struct Arguments const UNUSED *args, int argc, char *argv[]) -{ - char const *appdir; - int cur_dir = Eopen(".", O_RDONLY, 0); - struct dirent **entries; - int count, i; - - if (argc!=1) { - WRITE_MSG(2, "More than one vserver is not supported\n"); - exit(1); - } - - if (!initMatchListByVserver(&global_info.dst_list, argv[0], &appdir)) { - WRITE_MSG(2, "unification not configured for this vserver\n"); - exit(1); - } - - Echdir(appdir); - count = scandir(".", &entries, selectRefserver, alphasort); - if (count==-1) { - perror("scandir()"); - exit(1); - } - - if (count==0) { - WRITE_MSG(2, "no reference vserver configured\n"); - exit(1); - } - - global_info.src_lists.v = Emalloc(sizeof(struct MatchList) * count); - global_info.src_lists.l = count; - for (i=0; id_name; - size_t l = strlen(tmp); - char vname[sizeof("./") + l]; - - memcpy(vname, "./", 2); - memcpy(vname+2, tmp, l+1); - - if (!initMatchListByVserver(global_info.src_lists.v+i, vname, 0)) { - WRITE_MSG(2, "unification for reference vserver not configured\n"); - exit(1); - } - - free(entries[i]); - } - free(entries); - free(const_cast(char *)(appdir)); - - Efchdir(cur_dir); - Eclose(cur_dir); -} - int main(int argc, char *argv[]) { struct Arguments args = {