diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-07-27 02:58:28 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2006-07-27 02:58:28 -0600 |
commit | 2c6cf2b9d7360ccfb1f773feea39974cf513535f (patch) | |
tree | 6944ec02ac8c1ee1c738e7b53507bbc7b831de90 /kexec/kexec.c | |
parent | af598f5e5570b431a5fff2434ecb9cbe61586383 (diff) |
Fix arch option processing
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r-- | kexec/kexec.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c index 3847dbf..c19a227 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -37,6 +37,7 @@ #include "kexec-syscall.h" #include "kexec-elf.h" #include "kexec-sha256.h" +#include <arch/options.h> static unsigned long long mem_min = 0; static unsigned long long mem_max = ULONG_MAX; @@ -702,7 +703,7 @@ int main(int argc, char *argv[]) int result = 0; int fileind; static const struct option options[] = { - KEXEC_OPTIONS + KEXEC_ARCH_OPTIONS { 0, 0, 0, 0}, }; static const char short_options[] = KEXEC_OPT_STR; @@ -784,6 +785,16 @@ int main(int argc, char *argv[]) result = arch_process_options(argc, argv); + /* Check for bogus options */ + if (!do_load) { + while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) { + if ((opt == '?') || (opt >= OPT_ARCH_MAX)) { + usage(); + return 1; + } + } + } + if (do_unload) { result = k_unload(kexec_flags); } |