comparison vm/vm.c @ 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 a70f79850e5f
children 3daa43270d2c
comparison
equal deleted inserted replaced
398:ec2408d48b85 399:61edd6fa781b
52 #endif /* _MSC_VER */ 52 #endif /* _MSC_VER */
53 53
54 #ifdef __OS2__ 54 #ifdef __OS2__
55 #define INCL_DOS 55 #define INCL_DOS
56 #include <os2.h> 56 #include <os2.h>
57 #include <io.h> /* setmode() */
58 #include <fcntl.h> /* O_BINARY */
57 #endif 59 #endif
58 60
59 /* 61 /*
60 #define STRICT 62 #define STRICT
61 */ 63 */
142 { 144 {
143 HFILE hfile; 145 HFILE hfile;
144 ULONG ulAction; 146 ULONG ulAction;
145 ULONG rc; 147 ULONG rc;
146 148
147 rc = DosOpen( name, &hfile, &ulAction, 0, FILE_NORMAL, 149 rc = DosOpenL( name, &hfile, &ulAction, 0, FILE_NORMAL,
148 OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW, 150 OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
149 OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD, 151 OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
150 NULL ); 152 NULL );
151 153
152 if( rc ) 154 if( rc )
153 return -1; 155 return -1;
156
157 setmode( hfile, O_BINARY );
154 158
155 return ( int )hfile; 159 return ( int )hfile;
156 } 160 }
157 #endif 161 #endif
158 162