Bug 128878 - Another bug in catalyst2_rc40
|
Bug#:
128878
|
Product: Gentoo Hosted Projects
|
Version: unspecified
|
Platform: All
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: catalyst@gentoo.org
|
Reported By: liyiming@ict.ac.cn
|
|
Component: Catalyst
|
|
|
URL:
|
|
Summary: Another bug in catalyst2_rc40
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2006-04-05 01:50 0000
|
These are some codes in fcntl_unlock() function of catalyst_lock.py script.
Look carefully you will find that after excuting the first line and the second
line codes the rest codes will never be excuted.
1 if self.myfd == None:
2 return False
3 try:
4 if self.myfd == None:
5 self.myfd = os.open(self.lockfile, os.O_WRONLY,0660)
6 unlinkfile = 1
7 self.locking_method(self.myfd,fcntl.LOCK_UN)
*** Bug 128880 has been marked as a duplicate of this bug. ***
Sorry, I do not notice that I have clicked the commit button twice!
I cannot find this code in catalyst. Could you instead provide a patch?
Sorry,I did not give the exact line number in catalyst_lock.py
These codes are lied in 187 line.I think these codes should be constructed as
below:
if not os.path.exists(self.lockfile):
print "lockfile does not exist '%s'. Skipping Unlock..." % self.lo
if (self.myfd != None):
try:
os.close(myfd)
self.myfd=None
except:
pass
return False
else:
return False
try:
if self.myfd == None:
self.myfd = os.open(self.lockfile, os.O_WRONLY,0660)
unlinkfile = 1
self.locking_method(self.myfd,fcntl.LOCK_UN)
Sorry, could you please make a patch for this one. I can't tell if you've
changed something or removed something.
Thanks
--- catalyst_lock.py.original 2006-04-19 21:44:14.000000000 +0800
+++ catalyst_lock.py.changed 2006-04-20 09:33:47.000000000 +0800
@@ -183,10 +183,7 @@
self.myfd=None
except:
pass
- return False
- if self.myfd == None:
- return False
-
+ return False
try:
if self.myfd == None:
self.myfd = os.open(self.lockfile, os.O_WRONLY,0660)
this time ok?^^
That definitely makes more sense now, thank you.
This was apparently fixed in CVS without someone closing this bug. Without
taking the time to verify when it was fixed, I can guarantee you that it is
fixed in 2.0_rc46, which I am about to roll.