diff options
author | Nick Clifton <nickc@redhat.com> | 2006-08-06 15:49:46 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2006-08-06 15:49:46 +0000 |
commit | d68c385bfc389b5ba3c1cb5684febe74990b5725 (patch) | |
tree | 84133f1200209fd123721c542193166d1f2d6be9 /binutils/objcopy.c | |
parent | f301d54cd8e7649c6d1a4473932dcf7d3161b2c1 (diff) | |
download | gdb-d68c385bfc389b5ba3c1cb5684febe74990b5725.zip gdb-d68c385bfc389b5ba3c1cb5684febe74990b5725.tar.gz gdb-d68c385bfc389b5ba3c1cb5684febe74990b5725.tar.bz2 |
PR binutils/3001
* addr2line.c (process_file): Change function from void to returning an int. Return 0 upon success, 1 otherwise.
(main): Use return value from process_file as the exit value.
* ar.c (ranlib_only): Change function from void to returning an int. Return 0 upon success, 1 otherwise.
(ranlib_touch): Likewise.
(main): Use return value from ranlib functions as exit value.
* objcopy.c (add_specific_symbol): Set status to 1 if get_file_size fails.
(copy_file): Likewise.
(strip_main): Likewise.
(copy_main): Likewise.
* objdump.c (display_file): Set exit_status to 1 if get_file_size fails.
* size.c (display_file): Set return_code to 1 if get_file_size fails.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r-- | binutils/objcopy.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 06e500d..0d56845 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -653,7 +653,10 @@ add_specific_symbols (const char *filename, struct symlist **list) size = get_file_size (filename); if (size == 0) - return; + { + status = 1; + return; + } buffer = xmalloc (size + 2); f = fopen (filename, FOPEN_RT); @@ -1889,7 +1892,6 @@ copy_file (const char *input_filename, const char *output_filename, if (get_file_size (input_filename) < 1) { - non_fatal (_("error: the input file '%s' is empty"), input_filename); status = 1; return; } @@ -2612,7 +2614,10 @@ strip_main (int argc, char *argv[]) char *tmpname; if (get_file_size (argv[i]) < 1) - continue; + { + status = 1; + continue; + } if (preserve_dates) /* No need to check the return value of stat(). @@ -2623,8 +2628,8 @@ strip_main (int argc, char *argv[]) tmpname = output_file; else tmpname = make_tempname (argv[i]); - status = 0; + status = 0; copy_file (argv[i], tmpname, input_target, output_target); if (status == 0) { @@ -2640,7 +2645,7 @@ strip_main (int argc, char *argv[]) free (tmpname); } - return 0; + return status; } static int @@ -2809,7 +2814,10 @@ copy_main (int argc, char *argv[]) size = get_file_size (s + 1); if (size < 1) - break; + { + status = 1; + break; + } pa = xmalloc (sizeof (struct section_add)); |