1 # strip (and objcopy) fail to set the error code if there is no
2 # output file name and the rename of the stripped (or copied) file
3 # fails, yet the command fails to do anything. This fixes both
6 # modification by bero: Ported to 2.16.91.0.6
8 #Signed-off-by: John Bowler <jbowler@acm.org>
9 #Signed-off-by: Bernhard Rosenkraenzer <bero@arklinux.org>
11 # binutils/objcopy.c | 8 +++++---
12 # 1 file changed, 5 insertions(+), 3 deletions(-)
14 Index: src/binutils/objcopy.c
15 ===================================================================
16 --- src.orig/binutils/objcopy.c 2007-08-09 13:26:03.000000000 +0100
17 +++ src/binutils/objcopy.c 2007-08-09 16:36:12.000000000 +0100
18 @@ -2787,8 +2787,9 @@ strip_main (int argc, char *argv[])
20 set_times (tmpname, &statbuf);
21 if (output_file != tmpname)
22 - smart_rename (tmpname, output_file ? output_file : argv[i],
24 + if (smart_rename (tmpname, output_file ? output_file : argv[i],
30 @@ -3411,7 +3412,8 @@ copy_main (int argc, char *argv[])
32 set_times (tmpname, &statbuf);
33 if (tmpname != output_filename)
34 - smart_rename (tmpname, input_filename, preserve_dates);
35 + if (smart_rename (tmpname, input_filename, preserve_dates))
39 unlink_if_ordinary (tmpname);