]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
do not use logfile in lxc_init (V2)
authorMichel Normand <normand@fr.ibm.com>
Mon, 22 Mar 2010 10:08:34 +0000 (11:08 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Mon, 22 Mar 2010 10:08:34 +0000 (11:08 +0100)
The log file in lxc-init is quite useless as the code is trivial.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/arguments.c
src/lxc/lxc_init.c

index b5ab5b4e273a67c407ecfbb0b7afabfbefdc56d7..e495878d16072516d4a977953afcb75e671237f2 100644 (file)
@@ -207,10 +207,6 @@ extern char **lxc_arguments_dup(const char *file, struct lxc_arguments *args)
        char **argv;
        int opt, nbargs = args->argc + 2;
 
-       if (args->log_file)
-               nbargs += 2;
-       if (args->log_priority)
-               nbargs += 2;
        if (args->quiet)
                nbargs += 1;
 
@@ -222,16 +218,6 @@ extern char **lxc_arguments_dup(const char *file, struct lxc_arguments *args)
 
        argv[nbargs++] = strdup(file);
 
-       if (args->log_file) {
-               argv[nbargs++] = "--logfile";
-               argv[nbargs++] = strdup(args->log_file);
-       }
-
-       if (args->log_priority) {
-               argv[nbargs++] = "--logpriority";
-               argv[nbargs++] = strdup(args->log_priority);
-       }
-
        if (args->quiet)
                argv[nbargs++] = "--quiet";
 
index c540fc656bebaa82118a50d9fe77d914c13cff77..c151dd6c4d852a07a7b6184573a22a327979be1f 100644 (file)
 
 lxc_log_define(lxc_init, lxc);
 
-static char const *log_file;
-static char const *log_priority;
 static int quiet;
 
 static struct option options[] = {
-       { "logfile", required_argument, 0, 'o' },
-       { "logpriority", required_argument, 0, 'l' },
        { "quiet", no_argument, &quiet, 1 },
        { 0, 0, 0, 0 },
 };
@@ -61,16 +57,13 @@ int main(int argc, char *argv[])
                if (ret == -1) {
                        break;
                }
-               switch (ret) {
-               case 'o':       log_file = optarg; break;
-               case 'l':       log_priority = optarg; break;
-               case '?':
+               if  (ret == '?')
                        exit(err);
-               }
+
                nbargs++;
        }
 
-       if (lxc_log_init(log_file, log_priority, basename(argv[0]), quiet))
+       if (lxc_log_init(NULL, 0, basename(argv[0]), quiet))
                exit(err);
 
        if (!argv[optind]) {