diff options
author | H.J. Lu <hjl@lucon.org> | 2009-08-03 13:47:35 +0000 |
---|---|---|
committer | H.J. Lu <hjl@lucon.org> | 2009-08-03 13:47:35 +0000 |
commit | 3221ad28ae175c098e5519edd952fe33a6bcbfb3 (patch) | |
tree | 44fc5a356c6dd647a820dc346eb8077a5eb8bb9f /binutils/objcopy.c | |
parent | 2662dc03a10c1aefe4604c32f198b41aa670516c (diff) | |
download | binutils-redhat-3221ad28ae175c098e5519edd952fe33a6bcbfb3.tar.gz |
2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/10364
* objcopy.c (strip_main): Check return from smart_rename.
(copy_main): Likewise.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r-- | binutils/objcopy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 8908b564e1..b213132c79 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3014,9 +3014,11 @@ strip_main (int argc, char *argv[]) if (preserve_dates) set_times (tmpname, &statbuf); if (output_file != tmpname) - smart_rename (tmpname, output_file ? output_file : argv[i], - preserve_dates); - status = hold_status; + status = (smart_rename (tmpname, + output_file ? output_file : argv[i], + preserve_dates) != 0); + if (status == 0) + status = hold_status; } else unlink_if_ordinary (tmpname); @@ -3866,7 +3868,8 @@ copy_main (int argc, char *argv[]) if (preserve_dates) set_times (tmpname, &statbuf); if (tmpname != output_filename) - smart_rename (tmpname, input_filename, preserve_dates); + status = (smart_rename (tmpname, input_filename, + preserve_dates) != 0); } else unlink_if_ordinary (tmpname); |