summaryrefslogtreecommitdiff
path: root/bfd/trad-core.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-10-27 03:35:30 +0000
committerAlan Modra <amodra@gmail.com>2005-10-27 03:35:30 +0000
commitb677b8c0b935ebe9c4145fad3fabc9f1f753b830 (patch)
tree99c283174119cd8208f19a66e89d4fef637441f9 /bfd/trad-core.c
parentd0fdd288c7403a936f2a8e8cb52edb2076fb4dc3 (diff)
downloadbinutils-gdb-b677b8c0b935ebe9c4145fad3fabc9f1f753b830.tar.gz
* hppabsd-core.c (hppabsd_core_core_file_p): Use bfd_stat, not fstat.
* sco5-core.c (sco5_core_file_p): Likewise. * trad-core.c (trad_unix_core_file_p): Likewise.
Diffstat (limited to 'bfd/trad-core.c')
-rw-r--r--bfd/trad-core.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/bfd/trad-core.c b/bfd/trad-core.c
index c958683344a..2f8c9f9ca5f 100644
--- a/bfd/trad-core.c
+++ b/bfd/trad-core.c
@@ -1,6 +1,6 @@
/* BFD back end for traditional Unix core files (U-area and raw sections)
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004
+ 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
@@ -109,16 +109,11 @@ trad_unix_core_file_p (abfd)
/* Check that the size claimed is no greater than the file size. */
{
- FILE *stream = bfd_cache_lookup (abfd);
struct stat statbuf;
- if (stream == NULL)
+ if (bfd_stat (abfd, &statbuf) < 0)
return 0;
- if (fstat (fileno (stream), &statbuf) < 0)
- {
- bfd_set_error (bfd_error_system_call);
- return 0;
- }
+
if ((unsigned long) (NBPG * (UPAGES + u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
- u.u_tsize