diff options
author | Shawn O. Pearce <sop@google.com> | 2009-06-16 11:49:10 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-06-16 11:49:10 -0700 |
commit | 26120ca18dd8c2567b0df5a533d52d53c4111bc2 (patch) | |
tree | 08168f9a38f9498fb8abb348204a5bb97dcf1e7c /git_config.py | |
parent | 7da73d6f3ba579c67e58499b785dc4ac5beb9391 (diff) | |
download | git-repo-26120ca18dd8c2567b0df5a533d52d53c4111bc2.tar.gz |
Don't crash if the ssh client is already dead
If the SSH client terminated abnormally in the background (e.g. the
server shutdown while we were doing a sync) then the pid won't exist.
Instead of crashing, ignore it, the result we wanted (a non-orphaned
ssh process) is already acheived.
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py index d33c3b12..36e8d939 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -385,8 +385,11 @@ def _open_ssh(host, port): | |||
385 | 385 | ||
386 | def close_ssh(): | 386 | def close_ssh(): |
387 | for key,p in _ssh_cache.iteritems(): | 387 | for key,p in _ssh_cache.iteritems(): |
388 | os.kill(p.pid, SIGTERM) | 388 | try: |
389 | p.wait() | 389 | os.kill(p.pid, SIGTERM) |
390 | p.wait() | ||
391 | catch OSError: | ||
392 | pass | ||
390 | _ssh_cache.clear() | 393 | _ssh_cache.clear() |
391 | 394 | ||
392 | d = _ssh_sock(create=False) | 395 | d = _ssh_sock(create=False) |