--- a/bench.py Fri Aug 05 12:27:07 2016 +0800
+++ b/bench.py Sun Aug 07 12:59:40 2016 +0800
- flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL
- return os.fdopen(os.open(LOCKFILE, flags), 'w')
+ fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL)
+ os.write(fd, '%d' % os.getpid())
if e.errno == errno.EEXIST:
logging.error('cannot lock data directory')
+ if e.errno == errno.ENOENT:
+ logging.info("lock file %r doesn't exist", path)
names = args.marks.split(',')
marks = OrderedDict((k, v) for k, v in MARKS.items() if k in names)
+ lockfd = lock(LOCKFILE)
args.revsets = guessnew(args.auto, marks)
dbupdate(args.revsets, marks, args.mintime, args.mintries, args.retry)
+ unlock(lockfd, LOCKFILE)
if __name__ == '__main__':