diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-06-12 16:07:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-06-12 16:07:57 +0000 |
commit | 51ffc3bfc9ea611ad338f54fdfeb36ea2aaf796b (patch) | |
tree | 2b362a778f7ec2d1e3cd5eab493405d9be89109a /binutils/ar.c | |
parent | 2aca7949b036bad61b18fb654546efb7d7d62db5 (diff) | |
download | binutils-redhat-51ffc3bfc9ea611ad338f54fdfeb36ea2aaf796b.tar.gz |
* ar.c (O_BINARY): Define as 0 if not defined.
(ranlib_touch): Open file with O_BINARY.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r-- | binutils/ar.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |