* ar.c (extract_file): Set atime to mtime for ar xo.
authorJakub Jelinek <jakub@redhat.com>
Tue, 26 Oct 2004 08:08:21 +0000 (08:08 +0000)
committerJakub Jelinek <jakub@redhat.com>
Tue, 26 Oct 2004 08:08:21 +0000 (08:08 +0000)
binutils/ChangeLog
binutils/ar.c

index 3d833e40105ad124e567cd331dfc96bdc9121b1e..136ca4751071e97f1f293668712545b1fce1dede 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * ar.c (extract_file): Set atime to mtime for ar xo.
+
 2004-10-25  Ian Lance Taylor  <ian@wasabisystems.com>
 
        * stabs.c (stab_demangle_v3_arglist): New static function, broken
index ab54ace33e4e8a227fb79952a5521e894c8b7084..6cc7941db126d9479de43600b0b29df3cb1ef626 100644 (file)
@@ -935,7 +935,12 @@ extract_file (bfd *abfd)
   chmod (bfd_get_filename (abfd), buf.st_mode);
 
   if (preserve_dates)
-    set_times (bfd_get_filename (abfd), &buf);
+    {
+      /* Set access time to modification time.  Only st_mtime is
+        initialized by bfd_stat_arch_elt.  */
+      buf.st_atime = buf.st_mtime;
+      set_times (bfd_get_filename (abfd), &buf);
+    }
 
   free (cbuf);
 }