]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR27345, binutils/arsup.c: lstat() not available on all targets
authorAlan Modra <amodra@gmail.com>
Fri, 5 Feb 2021 02:29:16 +0000 (12:59 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 5 Feb 2021 04:45:14 +0000 (15:15 +1030)
We can just use stat here, the same as is done in ar.c:open_inarch.

PR 27345
* arsup.c (ar_save): Use stat rather than lstat.

(cherry picked from commit c180f095f32ca62f138da9bc7fb96cac0365fb5d)

binutils/ChangeLog
binutils/arsup.c

index c53a4b5eb1e17c8ff389cf1e0ee4bbf5b3b94c48..a568741661f304e2f8fc3e2070a08812608237fe 100644 (file)
@@ -1,3 +1,8 @@
+2021-02-05  Alan Modra  <amodra@gmail.com>
+
+       PR 27345
+       * arsup.c (ar_save): Use stat rather than lstat.
+
 2021-02-03  Alan Modra  <amodra@gmail.com>
 
        PR 27270
index a60629f67618f16407cb0f409b9a3e9259013fdb..fa7706f79e502fb5ffc57f8b8e3a97e8480a1752 100644 (file)
@@ -357,7 +357,7 @@ ar_save (void)
 #endif
       bfd_close (obfd);
 
-      if (lstat (real_name, &target_stat) != 0)
+      if (stat (real_name, &target_stat) != 0)
        {
          /* The temp file created in ar_open has mode 0600 as per mkstemp.
             Create the real empty output file here so smart_rename will