Commit 341553f7 by Michel Normand Committed by Daniel Lezcano

do not use logfile in lxc_init (V2)

The log file in lxc-init is quite useless as the code is trivial. Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarCedric Le Goater <clg@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent adc1e6c2
......@@ -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";
......
......@@ -38,13 +38,9 @@
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]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment