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: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
Michel Normand 2009-05-18 22:11:45 +02:00 committed by Daniel Lezcano
parent 4c200d12e0
commit fcffb59fc8

View File

@ -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[])
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[])
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]);