summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-09-07 14:54:13 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-09-07 14:54:13 +0000
commita261aa1386d760af32451215503b6ce594760801 (patch)
treeb535088a0569be765a80209aad6cf928d668e55b
parenta533f2fc67425edd445a477e61b122e9c73f27c4 (diff)
downloadgpsd-a261aa1386d760af32451215503b6ce594760801.tar.gz
Sanity check...
...may avoid a spurious error we occasionally see in regression testing.
-rw-r--r--gpsfake.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gpsfake.py b/gpsfake.py
index d202289d..de1d78c9 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -268,6 +268,8 @@ class DaemonInstance:
return False
def fd_set(self):
"Return the set of file descriptors currently opened by the daemon."
+ if self.pid == None:
+ return []
fds = map(int, os.listdir("/proc/%d/fd" % self.pid))
# I wish I knew what the entries above 1000 in Linux /proc/*/fd mean...
return filter(lambda x: x < 1000, fds)