Ignore:
Timestamp:
1999-09-21T23:28:45+12:00 (25 years ago)
Author:
sjboddie
Message:

tidied up file locking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r595 r606  
    2828/*
    2929   $Log$
     30   Revision 1.32  1999/09/21 11:28:45  sjboddie
     31   tidied up file locking
     32
    3033   Revision 1.31  1999/09/16 21:38:17  sjboddie
    3134   added some file locking stuff for logging. Windows still needs to
     
    179182#include <fstream.h>
    180183
    181 
     184#if defined (__WIN32_)
     185#include "wincgiutils.h"
     186#endif
    182187
    183188void recptconf::clear () {
     
    543548  outconverter->reset();
    544549
    545 
    546550  // check the main cgi arguments
    547551  if (!check_mainargs (args, logout)) return false;
     
    673677  }
    674678
    675   int fd = log.filedesc();
     679  int fd = GSDL_GET_FILEDESC(log);
     680
    676681  // lock_val is set to 0 if file is locked successfully
    677682  int lock_val = 1;
    678   WRITELOCK_FILE (fd);
     683  GSDL_LOCK_FILE (fd);
    679684  if (lock_val == 0) {
    680685    log << text_t2utf8 << logstr;
    681     UNLOCK_FILE (fd);
    682   } else
     686    GSDL_UNLOCK_FILE (fd);
     687  } else {
    683688    logout << "Error: Couldn't lock file " << lfile << "\n";
     689    log.close();
     690    delete lfile;
     691    return false;
     692  }
    684693
    685694  log.close();
     
    10651074  disp.setmacro ("httpimg", "Global", configinfo.httpimg);
    10661075  disp.setmacro ("httpprefix", "Global", configinfo.httpprefix);
    1067   disp.setmacro("compressedoptions", "Global", get_compressed_arg(args, logout));
     1076  disp.setmacro ("compressedoptions", "Global", get_compressed_arg(args, logout));
    10681077
    10691078  // set _cgiargX_ macros for each cgi argument
Note: See TracChangeset for help on using the changeset viewer.