Lock story
darcs-hash:20050104161033-d1718-df6013a8a853e05b58a37636ea01a115502dcc77.gz
This commit is contained in:
parent
13e14194c9
commit
98c2fe0277
2 changed files with 4 additions and 4 deletions
|
@ -1113,7 +1113,7 @@ def del_machine(machine) :
|
|||
machine.delete(res[0])
|
||||
except EnvironmentError, c :
|
||||
arg = u'--title "Destruction machine" '
|
||||
arg+= u'--msgbox "%s\n\n\n" 0 0' % c.args[0]
|
||||
arg+= u'--msgbox "ERREUR n°%s\n\n\n" 0 0' % c.args[0]
|
||||
dialog(arg)
|
||||
return 1
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ def wait_lock(lock_name, lock_comment='', d=None):
|
|||
"""
|
||||
from twisted.internet import reactor, defer
|
||||
try:
|
||||
make_lock(lock_name, lock_comment, quiet=True)
|
||||
make_lock(lock_name, lock_comment, nowait=1, quiet=True)
|
||||
# On a le lock
|
||||
if not d:
|
||||
# On est en mode synchrone
|
||||
|
@ -36,7 +36,7 @@ def wait_lock(lock_name, lock_comment='', d=None):
|
|||
reactor.callLater(0.2, wait_lock, lock_name, lock_comment, d)
|
||||
return d
|
||||
|
||||
def make_lock(lock_name, lock_comment='',nowait=1, quiet=False) :
|
||||
def make_lock(lock_name, lock_comment='',nowait=0, quiet=False) :
|
||||
""" Création d'un lock
|
||||
si nowait=1 fait un sys.exit(254) quand un ancien lock actif est rencontré
|
||||
"""
|
||||
|
@ -53,7 +53,7 @@ def make_lock(lock_name, lock_comment='',nowait=1, quiet=False) :
|
|||
try:
|
||||
lockf(lock_fd_dl, LOCK_EX | LOCK_NB)
|
||||
except IOError, e:
|
||||
if e.errno not in [errno.EACCESS, errno.EAGAIN]:
|
||||
if e.errno not in [errno.EACCES, errno.EAGAIN]:
|
||||
raise
|
||||
if nowait:
|
||||
if quiet:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue