Commit fcffb59f by Michel Normand Committed by Daniel Lezcano

in lxc-unshare remove log options

remove the -o and -l log options in src/lxc-unshared.c because these are useless for such a basic test command. It is sufficient to report the error to stderr. Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 4c200d12
...@@ -45,8 +45,6 @@ void usage(char *cmd) ...@@ -45,8 +45,6 @@ void usage(char *cmd)
"\t MOUNT, PID, UTSNAME, IPC, USER, NETWORK\n"); "\t MOUNT, PID, UTSNAME, IPC, USER, NETWORK\n");
fprintf(stderr, "\t -u <id> : new id to be set if -s USER is specified\n"); fprintf(stderr, "\t -u <id> : new id to be set if -s USER is specified\n");
fprintf(stderr, "\t if -f or -s PID is specified, <command> is mandatory)\n"); fprintf(stderr, "\t if -f or -s PID is specified, <command> is mandatory)\n");
fprintf(stderr, "\t[-o <logfile>] : path of the log file\n");
fprintf(stderr, "\t[-l <logpriority>]: log level priority\n");
_exit(1); _exit(1);
} }
...@@ -133,12 +131,11 @@ int main(int argc, char *argv[]) ...@@ -133,12 +131,11 @@ int main(int argc, char *argv[])
int ret; int ret;
char *namespaces = NULL; char *namespaces = NULL;
char **args; char **args;
const char *log_file = NULL, *log_priority = NULL;
long flags = 0; long flags = 0;
uid_t uid = -1; /* valid only if (flags & CLONE_NEWUSER) */ uid_t uid = -1; /* valid only if (flags & CLONE_NEWUSER) */
pid_t pid; pid_t pid;
while ((opt = getopt(argc, argv, "fs:u:o:l:")) != -1) { while ((opt = getopt(argc, argv, "fs:u:")) != -1) {
switch (opt) { switch (opt) {
case 's': case 's':
namespaces = optarg; namespaces = optarg;
...@@ -150,20 +147,11 @@ int main(int argc, char *argv[]) ...@@ -150,20 +147,11 @@ int main(int argc, char *argv[])
case 'f': case 'f':
hastofork = 1; hastofork = 1;
break; break;
case 'o':
log_file = optarg;
break;
case 'l':
log_priority = optarg;
break;
} }
} }
args = &argv[optind]; args = &argv[optind];
if (lxc_log_init(log_file, log_priority, basename(argv[0])))
return 1;
ret = lxc_fill_namespace_flags(namespaces, &flags); ret = lxc_fill_namespace_flags(namespaces, &flags);
if (ret) if (ret)
usage(argv[0]); usage(argv[0]);
......
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