(ranlib_touch): Open file with O_BINARY.
1999-06-12 Ian Lance Taylor <ian@zembu.com>
+ * 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.
#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 */
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);