PR27345, binutils/arsup.c: lstat() not available on all targets

Alan Modra amodra@gmail.com
Fri Feb 5 02:43:34 GMT 2021


We can just use stat here, the same as is done in ar.c:open_inarch.
The necessity for lstat is a more general problem needing changes
to smart_rename, I think.  See pr27349.

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

diff --git a/binutils/arsup.c b/binutils/arsup.c
index a60629f6761..fa7706f79e5 100644
--- a/binutils/arsup.c
+++ b/binutils/arsup.c
@@ -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

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list