aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-05-05 15:46:35 +0000
committerNick Clifton <nickc@redhat.com>2004-05-05 15:46:35 +0000
commit33216455a7084992c03481fee8a8320f98677ae1 (patch)
tree49f003e33849158ba305ecdc7a857fb90925ff2a
parent10a4b113218bc2f44aa4f511cc504e9b1c658bf4 (diff)
downloadfsf-binutils-gdb-33216455a7084992c03481fee8a8320f98677ae1.zip
fsf-binutils-gdb-33216455a7084992c03481fee8a8320f98677ae1.tar.gz
fsf-binutils-gdb-33216455a7084992c03481fee8a8320f98677ae1.tar.bz2
Remove checks of the return value from bfd_cache_ookup()
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/hppabsd-core.c3
-rw-r--r--bfd/sco5-core.c5
-rw-r--r--bfd/trad-core.c3
4 files changed, 9 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 554e3b4..d8b3666 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -4,6 +4,10 @@
* cache.c (bfd_cache_lookup_worker): Call abort() rather than
returning NULL as most users of this function do not check its
return value.
+ * hppabsd-core.c (hppabsd_core_core_file_p): Do not check result
+ of bfd_cache_lookup().
+ * sco5-core.c (sco5_core_file_p): Likewise.
+ * trad-core.c (trad_unix_core_file_p): Likewise.
2004-05-05 Nick Clifton <nickc@redhat.com>
diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c
index ff88f9d..be07c78 100644
--- a/bfd/hppabsd-core.c
+++ b/bfd/hppabsd-core.c
@@ -139,7 +139,8 @@ hppabsd_core_core_file_p (abfd)
{
FILE *stream = bfd_cache_lookup (abfd);
struct stat statbuf;
- if (stream == NULL || fstat (fileno (stream), &statbuf) < 0)
+
+ if (fstat (fileno (stream), &statbuf) < 0)
{
bfd_set_error (bfd_error_system_call);
return NULL;
diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c
index 5c34ff1..b88bd7b 100644
--- a/bfd/sco5-core.c
+++ b/bfd/sco5-core.c
@@ -123,13 +123,12 @@ sco5_core_file_p (abfd)
char *secname;
flagword flags;
- /* Read coreoffsets region at end of core (see core(FP)) */
+ /* Read coreoffsets region at end of core (see core(FP)). */
{
FILE *stream = bfd_cache_lookup (abfd);
struct stat statbuf;
- if (stream == NULL)
- return NULL;
+
if (fstat (fileno (stream), &statbuf) < 0)
{
bfd_set_error (bfd_error_system_call);
diff --git a/bfd/trad-core.c b/bfd/trad-core.c
index f8c03d7..1b9e69f 100644
--- a/bfd/trad-core.c
+++ b/bfd/trad-core.c
@@ -111,8 +111,7 @@ trad_unix_core_file_p (abfd)
{
FILE *stream = bfd_cache_lookup (abfd);
struct stat statbuf;
- if (stream == NULL)
- return 0;
+
if (fstat (fileno (stream), &statbuf) < 0)
{
bfd_set_error (bfd_error_system_call);