summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-01-14 13:14:06 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-01-14 13:14:06 +0000
commita8869f6c09c81263112ba80ef3f91a3bbe2eb91f (patch)
tree2f25e444b3901f77027b165a4e79cac076c6b33c /bfd
parent33e0a2a83803730c349902ca99f1050b6e737ba2 (diff)
downloadbinutils-redhat-a8869f6c09c81263112ba80ef3f91a3bbe2eb91f.tar.gz
PR binutils/14813
* bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06. (memory_bclose): Likewise. Return 0 on success. * cache.c (cache_bclose): Likewise. * opncls.c (opncls_bclose, bfd_close): Likewise. * vms-lib.c (vms_lib_bclose): Likewise. * libbfd.h: Regenerate.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/bfdio.c6
-rw-r--r--bfd/cache.c4
-rw-r--r--bfd/libbfd.h2
-rw-r--r--bfd/opncls.c6
-rw-r--r--bfd/vms-lib.c4
6 files changed, 21 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bd8d01bbea..c296b46503 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2013-01-14 Alan Modra <amodra@gmail.com>
+
+ PR binutils/14813
+ * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06.
+ (memory_bclose): Likewise. Return 0 on success.
+ * cache.c (cache_bclose): Likewise.
+ * opncls.c (opncls_bclose, bfd_close): Likewise.
+ * vms-lib.c (vms_lib_bclose): Likewise.
+ * libbfd.h: Regenerate.
+
2013-01-13 Alan Modra <amodra@gmail.com>
* elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak.
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index a80cd4f47d..be05581aeb 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -154,7 +154,7 @@ DESCRIPTION
. {* For the following, on successful completion a value of 0 is returned.
. Otherwise, a value of -1 is returned (and <<bfd_error>> is set). *}
. int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
-. bfd_boolean (*bclose) (struct bfd *abfd);
+. int (*bclose) (struct bfd *abfd);
. int (*bflush) (struct bfd *abfd);
. int (*bstat) (struct bfd *abfd, struct stat *sb);
. {* Mmap a part of the files. ADDR, LEN, PROT, FLAGS and OFFSET are the usual
@@ -576,7 +576,7 @@ memory_bseek (bfd *abfd, file_ptr position, int direction)
return 0;
}
-static bfd_boolean
+static int
memory_bclose (struct bfd *abfd)
{
struct bfd_in_memory *bim = (struct bfd_in_memory *) abfd->iostream;
@@ -586,7 +586,7 @@ memory_bclose (struct bfd *abfd)
free (bim);
abfd->iostream = NULL;
- return TRUE;
+ return 0;
}
static int
diff --git a/bfd/cache.c b/bfd/cache.c
index b1dcd5a745..52268162c2 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -359,10 +359,10 @@ cache_bwrite (struct bfd *abfd, const void *where, file_ptr nbytes)
return nwrite;
}
-static bfd_boolean
+static int
cache_bclose (struct bfd *abfd)
{
- return bfd_cache_close (abfd);
+ return bfd_cache_close (abfd) - 1;
}
static int
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index d548143c4c..7c78d9b05e 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -871,7 +871,7 @@ struct bfd_iovec
/* For the following, on successful completion a value of 0 is returned.
Otherwise, a value of -1 is returned (and <<bfd_error>> is set). */
int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
- bfd_boolean (*bclose) (struct bfd *abfd);
+ int (*bclose) (struct bfd *abfd);
int (*bflush) (struct bfd *abfd);
int (*bstat) (struct bfd *abfd, struct stat *sb);
/* Mmap a part of the files. ADDR, LEN, PROT, FLAGS and OFFSET are the usual
diff --git a/bfd/opncls.c b/bfd/opncls.c
index cbdb46e1b7..c18d08af38 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -508,7 +508,7 @@ opncls_bwrite (struct bfd *abfd ATTRIBUTE_UNUSED,
return -1;
}
-static bfd_boolean
+static int
opncls_bclose (struct bfd *abfd)
{
struct opncls *vec = (struct opncls *) abfd->iostream;
@@ -518,7 +518,7 @@ opncls_bclose (struct bfd *abfd)
if (vec->close != NULL)
status = (vec->close) (abfd, vec->stream);
abfd->iostream = NULL;
- return status == 0;
+ return status;
}
static int
@@ -723,7 +723,7 @@ bfd_close (bfd *abfd)
if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
return FALSE;
- ret = abfd->iovec->bclose (abfd);
+ ret = abfd->iovec->bclose (abfd) == 0;
if (ret)
_maybe_make_executable (abfd);
diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c
index 8aa0e9a7f4..b553570d80 100644
--- a/bfd/vms-lib.c
+++ b/bfd/vms-lib.c
@@ -1174,11 +1174,11 @@ vms_lib_bwrite (struct bfd *abfd ATTRIBUTE_UNUSED,
return -1;
}
-static bfd_boolean
+static int
vms_lib_bclose (struct bfd *abfd)
{
abfd->iostream = NULL;
- return TRUE;
+ return 0;
}
static int