From d84feeaca53698f5e014813e923abe6807e13f22 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 12 Jun 1999 16:07:57 +0000 Subject: [PATCH] * ar.c (O_BINARY): Define as 0 if not defined. (ranlib_touch): Open file with O_BINARY. --- binutils/ChangeLog | 3 +++ binutils/ar.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index ab0b602ca3..4adb7d4065 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,8 @@ 1999-06-12 Ian Lance Taylor + * ar.c (O_BINARY): Define as 0 if not defined. + (ranlib_touch): Open file with O_BINARY. + * rename.c (O_BINARY): Define as 0 if not defined. (simple_copy): Open files with O_BINARY. diff --git a/binutils/ar.c b/binutils/ar.c index c951ef7b45..3e9dcefd92 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -40,6 +40,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define EXT_NAME_LEN 6 /* ditto for *NIX */ #endif +/* We need to open files in binary modes on system where that makes a + difference. */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #define BUFSIZE 8192 /* Kludge declaration from BFD! This is ugly! FIXME! XXX */ @@ -1296,7 +1302,7 @@ ranlib_touch (archname) bfd *arch; char **matching; - f = open (archname, O_RDWR, 0); + f = open (archname, O_RDWR | O_BINARY, 0); if (f < 0) { bfd_set_error (bfd_error_system_call); -- 2.34.1