mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 21:32:12 +02:00
bitbake: bitbake: prserv/serv: Use with while reading pidfile
(Bitbake rev: 405a9068ce5072050b9878f7cec15b2c2592bc4e) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4bedd3c452
commit
beda62448d
@@ -379,9 +379,8 @@ def stop_daemon(host, port):
|
||||
ip = socket.gethostbyname(host)
|
||||
pidfile = PIDPREFIX % (ip, port)
|
||||
try:
|
||||
pf = open(pidfile,'r')
|
||||
pid = int(pf.readline().strip())
|
||||
pf.close()
|
||||
with open(pidfile) as pf:
|
||||
pid = int(pf.readline().strip())
|
||||
except IOError:
|
||||
pid = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user