From: Sami Kerola Date: Sun, 28 Aug 2011 10:01:09 +0000 (+0200) Subject: setarch: move options struct to function scope X-Git-Tag: v2.21-rc1~402^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=745627993ba07411e15badf5eb03a7b7e660f26c;p=thirdparty%2Futil-linux.git setarch: move options struct to function scope Signed-off-by: Sami Kerola --- diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index a33be70d75..865867075e 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -86,27 +86,6 @@ enum { # define ADDR_LIMIT_3GB 0x8000000 #endif -/* Options --3gb and --4gb are for compatibitity with an old Debian setarch - implementation. */ -static const struct option longopts[] = -{ - { "help", 0, 0, 'h' }, - { "verbose", 0, 0, 'v' }, - { "addr-no-randomize", 0, 0, 'R' }, - { "fdpic-funcptrs", 0, 0, 'F' }, - { "mmap-page-zero", 0, 0, 'Z' }, - { "addr-compat-layout", 0, 0, 'L' }, - { "read-implies-exec", 0, 0, 'X' }, - { "32bit", 0, 0, 'B' }, - { "short-inode", 0, 0, 'I' }, - { "whole-seconds", 0, 0, 'S' }, - { "sticky-timeouts", 0, 0, 'T' }, - { "3gb", 0, 0, '3' }, - { "4gb", 0, 0, OPT_4GB }, - { "uname-2.6", 0, 0, OPT_UNAME26 }, - { NULL, 0, 0, 0 } -}; - static void __attribute__((__noreturn__)) show_help(void) { @@ -248,6 +227,27 @@ int main(int argc, char *argv[]) int verbose = 0; int c; + /* Options --3gb and --4gb are for compatibitity with an old Debian setarch + implementation. */ + static const struct option longopts[] = + { + { "help", 0, 0, 'h' }, + { "verbose", 0, 0, 'v' }, + { "addr-no-randomize", 0, 0, 'R' }, + { "fdpic-funcptrs", 0, 0, 'F' }, + { "mmap-page-zero", 0, 0, 'Z' }, + { "addr-compat-layout", 0, 0, 'L' }, + { "read-implies-exec", 0, 0, 'X' }, + { "32bit", 0, 0, 'B' }, + { "short-inode", 0, 0, 'I' }, + { "whole-seconds", 0, 0, 'S' }, + { "sticky-timeouts", 0, 0, 'T' }, + { "3gb", 0, 0, '3' }, + { "4gb", 0, 0, OPT_4GB }, + { "uname-2.6", 0, 0, OPT_UNAME26 }, + { NULL, 0, 0, 0 } + }; + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE);