* ar.c (O_BINARY): Define as 0 if not defined.
[deliverable/binutils-gdb.git] / binutils / ar.c
index c951ef7b45079a8d0fba5751b74e3e385898dae4..3e9dcefd92d25002a68821b0ee490b1673c210af 100644 (file)
@@ -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);
This page took 0.024328 seconds and 4 git commands to generate.