From b677b8c0b935ebe9c4145fad3fabc9f1f753b830 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 27 Oct 2005 03:35:30 +0000 Subject: * 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. --- bfd/sco5-core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'bfd/sco5-core.c') diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c index e85c4d3793..f09eadafe8 100644 --- a/bfd/sco5-core.c +++ b/bfd/sco5-core.c @@ -1,5 +1,5 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Jouke Numan @@ -126,16 +126,11 @@ sco5_core_file_p (abfd) /* Read coreoffsets region at end of core (see core(FP)). */ { - 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; - } + coresize = statbuf.st_size; } /* Last long in core is sizeof struct coreoffsets, read it */ -- cgit v1.2.3