changeset 399:61edd6fa781b src

OS/2 portability fix This commit only touches the OS/2 port. The function os2_open is changed to perform the large file open call instead of the regular file open call. And there is a setmode call to explicitly set the DOS file mode to binary. This commit is directly from the patch sent in by KO Myung-Hun <komh AT chollian DOT net>. Thanks!
author erik
date Sun, 06 Sep 2009 15:26:39 +0000
parents ec2408d48b85
children 3daa43270d2c
files vm/vm.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vm/vm.c	Wed Apr 22 07:40:57 2009 +0000
+++ b/vm/vm.c	Sun Sep 06 15:26:39 2009 +0000
@@ -54,6 +54,8 @@
 #ifdef __OS2__
 #define INCL_DOS
 #include <os2.h>
+#include <io.h>     /* setmode() */
+#include <fcntl.h>  /* O_BINARY  */
 #endif
 
 /*
@@ -144,14 +146,16 @@
     ULONG ulAction;
     ULONG rc;
 
-    rc = DosOpen( name, &hfile, &ulAction, 0, FILE_NORMAL,
-                  OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
-                  OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
-                  NULL );
+    rc = DosOpenL( name, &hfile, &ulAction, 0, FILE_NORMAL,
+                   OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
+                   OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
+                   NULL );
 
     if( rc )
         return -1;
 
+    setmode( hfile, O_BINARY );
+
     return ( int )hfile;
 }
 #endif