moved init*() functions to vunify-init.c
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sat, 17 Jan 2004 05:24:19 +0000 (05:24 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sat, 17 Jan 2004 05:24:19 +0000 (05:24 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@635 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/vunify.c

index 7630329..d0bc7c0 100644 (file)
@@ -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; i<count; ++i)
-    initMatchList(global_info.src_lists.v+i, 0, argv[2 + i*2], argv[3 + i*2]);
-}
-
-static int
-selectRefserver(struct dirent const *ent)
-{
-  return strncmp(ent->d_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; i<count; ++i) {
-    char const                 *tmp   = entries[i]->d_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 = {