diff options
author | Jamis Buck <jamis@37signals.com> | 2008-04-05 22:03:35 -0600 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2008-04-05 22:03:35 -0600 |
commit | 399de409d113b9a07a5ba9025e3cebd0fe33865c (patch) | |
tree | 675164fe922aac69c0a5e9abdee75e81395c84a6 | |
parent | 00a293caef3c52f35791cb0dd3cfd3ff4d1b2669 (diff) | |
download | net-ssh-gateway-399de409d113b9a07a5ba9025e3cebd0fe33865c.tar.gz |
auto close the port if the connect failed
-rw-r--r-- | lib/net/ssh/gateway.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/ssh/gateway.rb b/lib/net/ssh/gateway.rb index aed6bdd..fce7c3e 100644 --- a/lib/net/ssh/gateway.rb +++ b/lib/net/ssh/gateway.rb @@ -165,7 +165,7 @@ class Net::SSH::Gateway begin Net::SSH.start("127.0.0.1", user, options.merge(:port => local_port), &block) ensure - close(local_port) if block + close(local_port) if block || $! end end |