aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-01-14 13:14:08 +0000
committerAlan Modra <amodra@gmail.com>2013-01-14 13:14:08 +0000
commit405bf443e52b6986413e7b02cb783e4ae92b0dda (patch)
tree87d44f7a0c74676bc6ccccee729cf23956a6151f
parent130b4629e4d842da9d371f4b28397cfc591db035 (diff)
downloadgdb-405bf443e52b6986413e7b02cb783e4ae92b0dda.zip
gdb-405bf443e52b6986413e7b02cb783e4ae92b0dda.tar.gz
gdb-405bf443e52b6986413e7b02cb783e4ae92b0dda.tar.bz2
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.
-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 bd8d01b..c296b46 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 a80cd4f..be05581 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 b1dcd5a..5226816 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 d548143..7c78d9b 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 cbdb46e..c18d08a 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 8aa0e9a..b553570 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