From: Ulrich Drepper Date: Mon, 2 Feb 2009 00:18:18 +0000 (-0800) Subject: Fix error handling in a few programs. X-Git-Tag: elfutils-0.140~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ee720c60a298352b52513d03ede85814ab63ad5;p=thirdparty%2Felfutils.git Fix error handling in a few programs. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4886bcf2c..3e960021b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2009-02-01 Ulrich Drepper + + * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers. + Improve some error messages. + Use program_invocation_short_name instead of AR macro. + * Makefile.am (CFLAGS_ar): Remove. + * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help. + * objdump.c (parse_opt): Likewise. + * readelf.c (parse_opt): Likewise. + 2009-01-24 Ulrich Drepper * readelf.c (print_debug_frame_section): Fix computation of vma_base diff --git a/src/Makefile.am b/src/Makefile.am index c92accbe1..64e4478be 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -130,7 +130,6 @@ objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) strings_LDADD = $(libelf) $(libeu) $(libmudflap) ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) -CFLAGS_ar = -DAR=\"$(shell echo ar|sed '$(transform)')\" unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl ldlex.o: ldscript.c diff --git a/src/elflint.c b/src/elflint.c index 826d94c3d..7ddf3a9a3 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -220,9 +220,8 @@ parse_opt (int key, char *arg __attribute__ ((unused)), case ARGP_KEY_NO_ARGS: fputs (gettext ("Missing file name.\n"), stderr); - argp_help (&argp, stderr, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, - program_invocation_short_name); - exit (1); + argp_help (&argp, stderr, ARGP_HELP_SEE, program_invocation_short_name); + exit (EXIT_FAILURE); default: return ARGP_ERR_UNKNOWN; diff --git a/src/objdump.c b/src/objdump.c index 7f6394100..1a62a0222 100644 --- a/src/objdump.c +++ b/src/objdump.c @@ -234,9 +234,9 @@ parse_opt (int key, char *arg, if (! any_control_option) { fputs (gettext ("No operation specified.\n"), stderr); - argp_help (&argp, stderr, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, + argp_help (&argp, stderr, ARGP_HELP_SEE, program_invocation_short_name); - exit (1); + exit (EXIT_FAILURE); } default: diff --git a/src/readelf.c b/src/readelf.c index 55c906f7d..bc0e4fd03 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -412,9 +412,9 @@ parse_opt (int key, char *arg, { fputs (gettext ("No operation specified.\n"), stderr); do_argp_help: - argp_help (&argp, stderr, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR, + argp_help (&argp, stderr, ARGP_HELP_SEE, program_invocation_short_name); - exit (1); + exit (EXIT_FAILURE); } break; default: