Changeset 18064

Show
Ignore:
Timestamp:
04.12.2008 13:02:55 (11 years ago)
Author:
mdewsnip
Message:

On Windows (only) the open() commands need the O_BINARY flag to work properly.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/gdbmopen.c

    r18038 r18064  
    130130    { 
    131131      case GDBM_READER: 
     132#ifdef MSDOS 
     133    dbf->desc = open (dbf->name, O_RDONLY|O_BINARY, 0); 
     134#else 
    132135    dbf->desc = open (dbf->name, O_RDONLY, 0); 
     136#endif 
    133137    break; 
    134138 
    135139      case GDBM_WRITER: 
     140#ifdef MSDOS 
     141    dbf->desc = open (dbf->name, O_RDWR|O_BINARY, 0); 
     142#else 
    136143    dbf->desc = open (dbf->name, O_RDWR, 0); 
     144#endif 
    137145    break; 
    138146 
    139147      case GDBM_NEWDB: 
     148#ifdef MSDOS 
     149    dbf->desc = open (dbf->name, O_RDWR|O_CREAT|O_BINARY, mode); 
     150#else 
    140151    dbf->desc = open (dbf->name, O_RDWR|O_CREAT, mode); 
     152#endif 
    141153    need_trunc = TRUE; 
    142154    break; 
    143155 
    144156      default: 
     157#ifdef MSDOS 
     158    dbf->desc = open (dbf->name, O_RDWR|O_CREAT|O_BINARY, mode); 
     159#else 
    145160    dbf->desc = open (dbf->name, O_RDWR|O_CREAT, mode); 
     161#endif 
    146162    break; 
    147163