diff options
| author | bwarsaw | 2000-06-20 05:36:45 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-06-20 05:36:45 +0000 |
| commit | 3e8b587c9b36650a44c8fe7530b4fdc0e6e66303 (patch) | |
| tree | b05f76b209ff7fd3b6b5d8b907ba2755d42349b5 /Mailman/Utils.py | |
| parent | ca3aba93efd52ef5acb182d8b030a843b2d06aeb (diff) | |
| download | mailman-3e8b587c9b36650a44c8fe7530b4fdc0e6e66303.tar.gz mailman-3e8b587c9b36650a44c8fe7530b4fdc0e6e66303.tar.zst mailman-3e8b587c9b36650a44c8fe7530b4fdc0e6e66303.zip | |
reap(): Wait on a dictionary of child pids. Moved here from gate_news
so other scripts can use it.
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 327583f68..77f8bb669 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -593,3 +593,16 @@ def GetRequestURI(fallback=None): return os.environ['SCRIPT_NAME'] + os.environ['PATH_INFO'] else: return fallback + + + +# Wait on a dictionary of child pids +def reap(kids): + while kids: + pid, status = os.waitpid(-1, os.WNOHANG) + if pid <> 0: + try: + del kids[pid] + except KeyError: + # Huh? How can this happen? + pass |
