Changeset 175 for etherws


Ignore:
Timestamp:
07/25/12 01:58:32 (12 years ago)
Author:
atzm
Message:
  • acquire shared lock while loading htpasswd
File:
1 edited

Legend:

Unmodified
Added
Removed
  • etherws/trunk/etherws.py

    r174 r175  
    4545import ssl 
    4646import time 
     47import fcntl 
    4748import base64 
    4849import hashlib 
     
    339340 
    340341        with open(self._path) as fp: 
    341             self._stat = os.fstat(fp.fileno()) 
     342            fileno = fp.fileno() 
     343            fcntl.flock(fileno, fcntl.LOCK_SH | fcntl.LOCK_NB) 
     344            self._stat = os.fstat(fileno) 
    342345 
    343346            unchanged = old_stat and \ 
Note: See TracChangeset for help on using the changeset viewer.