Changeset 18074

Show
Ignore:
Timestamp:
04.12.2008 14:08:23 (11 years ago)
Author:
mdewsnip
Message:

Added "need_filelock" stuff from old Windows GDBM port -- not sure if it is still necessary, but I'm not taking the chance.

Location:
gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3
Files:
6 modified

Legend:

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

    r18019 r18074  
    5050  if (dbf->file_locking) 
    5151    { 
     52#ifdef MSDOS 
     53      if (dbf->need_filelock) { 
     54    UNLOCK_FILE(dbf); 
     55      } 
     56#else 
    5257      UNLOCK_FILE(dbf); 
     58#endif 
    5359    } 
    5460  close (dbf->desc); 
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/gdbmdefs.h

    r18019 r18074  
    170170    void (*fatal_err) (); 
    171171 
     172#ifdef MSDOS 
     173        int need_filelock; 
     174#endif 
     175 
    172176    /* The gdbm file descriptor which is set in gdbm_open.  */ 
    173177    int desc; 
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/gdbmopen.c

    r18064 r18074  
    5858 
    5959gdbm_file_info * 
     60#ifdef MSDOS 
     61gdbm_open (file, block_size, flags, mode, fatal_func, need_filelock) 
     62#else 
    6063gdbm_open (file, block_size, flags, mode, fatal_func) 
     64#endif 
    6165     char *file; 
    6266     int  block_size; 
     
    6468     int  mode; 
    6569     void (*fatal_func) (); 
     70#ifdef MSDOS 
     71     int need_filelock; 
     72#endif 
    6673{ 
    6774  gdbm_file_info *dbf;      /* The record to return. */ 
     
    8996  /* Initialize some fields for known values.  This is done so gdbm_close 
    9097     will work if called before allocating some structures. */ 
     98#ifdef MSDOS 
     99  dbf->need_filelock = need_filelock; 
     100#endif 
    91101  dbf->dir  = NULL; 
    92102  dbf->bucket = NULL; 
     
    187197      if (dbf->file_locking) 
    188198    { 
    189           /* Sets lock_val to 0 for success.  See systems.h. */ 
    190           READLOCK_FILE(dbf); 
     199      /* Sets lock_val to 0 for success.  See systems.h. */ 
     200#ifdef MSDOS 
     201      if (dbf->need_filelock) { 
     202        READLOCK_FILE(dbf); 
     203      } 
     204      else { 
     205        lock_val = 0; 
     206      } 
     207#else 
     208      READLOCK_FILE(dbf); 
     209#endif 
    191210    } 
    192211    } 
     
    194213    { 
    195214      /* Sets lock_val to 0 for success.  See systems.h. */ 
     215#ifdef MSDOS 
     216      if (dbf->need_filelock) { 
     217    WRITELOCK_FILE(dbf); 
     218      } 
     219      else { 
     220    lock_val = 0; 
     221      } 
     222#else 
    196223      WRITELOCK_FILE(dbf); 
     224#endif 
    197225    } 
    198226  if (dbf->file_locking && (lock_val != 0)) 
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/gdbmreorg.c

    r18060 r18074  
    182182  if (dbf->file_locking) 
    183183    { 
     184#ifdef MSDOS 
     185      if (dbf->need_filelock) { 
     186    UNLOCK_FILE(dbf); 
     187      } 
     188#else 
    184189      UNLOCK_FILE(dbf); 
     190#endif 
    185191    } 
    186192  close (dbf->desc); 
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/proto.h

    r18019 r18074  
    6565int   gdbm_delete     __P((gdbm_file_info *, datum)); 
    6666datum gdbm_fetch      __P((gdbm_file_info *, datum)); 
     67#ifdef MSDOS 
     68gdbm_file_info *gdbm_open __P((char *, int, int, int, void (*) (void), int)); 
     69#else 
    6770gdbm_file_info *gdbm_open __P((char *, int, int, int, void (*) (void))); 
     71#endif 
    6872int   gdbm_reorganize     __P((gdbm_file_info *)); 
    6973datum gdbm_firstkey       __P((gdbm_file_info *)); 
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/windows/gdbm.h

    r18058 r18074  
    8383/* These are the routines! */ 
    8484 
     85#ifdef MSDOS 
     86extern GDBM_FILE gdbm_open __P((char *, int, int, int, void (*)(), int)); 
     87#else 
    8588extern GDBM_FILE gdbm_open __P((char *, int, int, int, void (*)())); 
     89#endif 
    8690extern void gdbm_close __P((GDBM_FILE)); 
    8791extern int gdbm_store __P((GDBM_FILE, datum, datum, int));