Skip to content

Commit

Permalink
Set pidfd preemptively to fix null reference
Browse files Browse the repository at this point in the history
  • Loading branch information
johnramsden committed Dec 24, 2018
1 parent 2bbe890 commit 227ed97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zedenv/lib/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class Pidfile:

def __init__(self, name="zedenv.pid", directory="/var/run"):
self.pidfile = os.path.join(directory, name)
self.pidfd = None

def __enter__(self):
if os.path.exists(self.pidfile):

pid = None
with open(self.pidfile) as f:
pid = self._check()
Expand Down

0 comments on commit 227ed97

Please sign in to comment.