Fixed a typo in trying to bitwise OR non blocking locking which probably
made that the parse "-n" argument never worked.
Signed-off-by: Mihai Rusu <dizzy@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2703 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/parse.py b/tko/parse.py
index feff307..4146029 100755
--- a/tko/parse.py
+++ b/tko/parse.py
@@ -194,11 +194,11 @@
lockfile = open(os.path.join(path, ".parse.lock"), "w")
flags = fcntl.LOCK_EX
if options.noblock:
- flags != fcntl.LOCK_NB
+ flags |= fcntl.LOCK_NB
try:
fcntl.flock(lockfile, flags)
except IOError, e:
- # was this because the lock is unavailable?
+ # lock is not available and nonblock has been requested
if e.errno == errno.EWOULDBLOCK:
lockfile.close()
continue