summaryrefslogtreecommitdiff
path: root/bfd/hppabsd-core.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-10-27 03:35:30 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-10-27 03:35:30 +0000
commit7764f3fbb098728d90a9ee21b7cdcf3ff2acc25b (patch)
treec50f499cc8644ab74b88941162e93555f9174950 /bfd/hppabsd-core.c
parent48ddc78bad6c949dab89fb9e38f9861078b7ac2f (diff)
downloadgdb-7764f3fbb098728d90a9ee21b7cdcf3ff2acc25b.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/hppabsd-core.c')
-rw-r--r--bfd/hppabsd-core.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c
index b17acc699fc..894d244bbc3 100644
--- a/bfd/hppabsd-core.c
+++ b/bfd/hppabsd-core.c
@@ -1,5 +1,5 @@
/* BFD back-end for HPPA BSD core files.
- Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004
+ Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -137,16 +137,11 @@ hppabsd_core_core_file_p (abfd)
/* Sanity checks. Make sure the size of the core file matches the
the size computed from information within the core itself. */
{
- FILE *stream = bfd_cache_lookup (abfd);
struct stat statbuf;
- if (stream == NULL)
+ if (bfd_stat (abfd, &statbuf) < 0)
return NULL;
- if (fstat (fileno (stream), &statbuf) < 0)
- {
- bfd_set_error (bfd_error_system_call);
- return NULL;
- }
+
if (NBPG * (UPAGES + u.u_dsize + u.u_ssize) > statbuf.st_size)
{
bfd_set_error (bfd_error_file_truncated);