Skip to content

Commit

Permalink
ecoff: check result of stat
Browse files Browse the repository at this point in the history
	* ecoff.c (_bfd_ecoff_write_armap): Don't use statbuf.st_mtime
	if stat call returns non-zero.  Use ARMAP_TIME_OFFSET rather
	than its expansion.
  • Loading branch information
amodra committed Mar 3, 2025
1 parent a8a9fc7 commit 7720707
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bfd/ecoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3132,9 +3132,9 @@ _bfd_ecoff_write_armap (bfd *abfd,
complain that the index is out of date. Actually, the Ultrix
linker just checks the archive name; the GNU linker may check the
date. */
stat (bfd_get_filename (abfd), &statbuf);
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
(long) (statbuf.st_mtime + 60));
if (stat (bfd_get_filename (abfd), &statbuf) == 0)
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
(long) (statbuf.st_mtime + ARMAP_TIME_OFFSET));

/* The DECstation uses zeroes for the uid, gid and mode of the
armap. */
Expand Down

0 comments on commit 7720707

Please sign in to comment.