summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/pyinotify.py
diff options
context:
space:
mode:
authorFrazer Clews <frazer.clews@codethink.co.uk>2020-01-16 17:11:19 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:31:05 +0000
commitfa5524890e86d353ee7d2194ccdd6c84e9bd2d31 (patch)
treef3d46ddbd5dd2b772a727b04303bb97b8ae43b9b /bitbake/lib/pyinotify.py
parent0ac5174c7d39a3e49893df0d517d47bec1935555 (diff)
downloadpoky-fa5524890e86d353ee7d2194ccdd6c84e9bd2d31.tar.gz
bitbake: lib: amend code to use proper singleton comparisons where possible
amend the code to handle singleton comparisons properly so it only checks if they only refer to the same object or not, and not bother comparing the values. (Bitbake rev: b809a6812aa15a8a9af97bc382cc4b19571e6bfc) Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/pyinotify.py')
-rw-r--r--bitbake/lib/pyinotify.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/pyinotify.py b/bitbake/lib/pyinotify.py
index 1528a22e8d..6ae40a2d76 100644
--- a/bitbake/lib/pyinotify.py
+++ b/bitbake/lib/pyinotify.py
@@ -1274,7 +1274,7 @@ class Notifier:
1274 basename = os.path.basename(sys.argv[0]) or 'pyinotify' 1274 basename = os.path.basename(sys.argv[0]) or 'pyinotify'
1275 pid_file = os.path.join(dirname, basename + '.pid') 1275 pid_file = os.path.join(dirname, basename + '.pid')
1276 1276
1277 if pid_file != False and os.path.lexists(pid_file): 1277 if pid_file and os.path.lexists(pid_file):
1278 err = 'Cannot daemonize: pid file %s already exists.' % pid_file 1278 err = 'Cannot daemonize: pid file %s already exists.' % pid_file
1279 raise NotifierError(err) 1279 raise NotifierError(err)
1280 1280
@@ -1308,7 +1308,7 @@ class Notifier:
1308 fork_daemon() 1308 fork_daemon()
1309 1309
1310 # Write pid 1310 # Write pid
1311 if pid_file != False: 1311 if pid_file:
1312 flags = os.O_WRONLY|os.O_CREAT|os.O_NOFOLLOW|os.O_EXCL 1312 flags = os.O_WRONLY|os.O_CREAT|os.O_NOFOLLOW|os.O_EXCL
1313 fd_pid = os.open(pid_file, flags, 0o0600) 1313 fd_pid = os.open(pid_file, flags, 0o0600)
1314 os.write(fd_pid, bytes(str(os.getpid()) + '\n', 1314 os.write(fd_pid, bytes(str(os.getpid()) + '\n',