summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-16 16:47:39 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-16 16:47:39 +0000
commitf01896e62672f71b04798c83752b36ccb628db67 (patch)
tree84e433393cb4baedb6d8375a764a165e5dd74f1f
parente9b7e730d6efab10f5cc0e7b582e95098b9db881 (diff)
downloadmorph-f01896e62672f71b04798c83752b36ccb628db67.tar.gz
scripts/distbuild: Ensure process names are unique
Previously, duplicate names would cause the ProcessMonitor class to forget about processes, and leave them running after the process exits.
-rwxr-xr-xscripts/distbuild3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/distbuild b/scripts/distbuild
index 2f0e666e..df4e4dea 100755
--- a/scripts/distbuild
+++ b/scripts/distbuild
@@ -223,6 +223,9 @@ class ProcessMonitor(object):
def watch(self, process):
'''Start monitoring a running process.'''
+ if process.name in self.process:
+ raise KeyError('Already watching a process named %s.' %
+ process.name)
self.process[process.name] = process
def check_all(self):