From: Alan Modra Date: Mon, 14 Jan 2013 13:14:08 +0000 (+0000) Subject: PR binutils/14813 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=405bf443e52b6986413e7b02cb783e4ae92b0dda;p=binutils-gdb.git PR binutils/14813 * bfdio.c (struct bfd_iovec ): 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bd8d01bbea8..c296b465036 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2013-01-14 Alan Modra + + PR binutils/14813 + * bfdio.c (struct bfd_iovec ): 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 * elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak. diff --git a/bfd/bfdio.c b/bfd/bfdio.c index a80cd4f47db..be05581aeb4 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 <> 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 b1dcd5a745b..52268162c26 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 d548143c4ce..7c78d9b05e0 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 <> 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 cbdb46e1b7a..c18d08af388 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 8aa0e9a7f40..b553570d80a 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