aboutsummaryrefslogtreecommitdiffstats
path: root/include/nms.pm
diff options
context:
space:
mode:
authorKnut Auvor Grythe <knut@auvor.no>2015-04-04 08:12:36 +0200
committerroot <root@einstein.tg15.gathering.org>2015-04-04 08:12:36 +0200
commitb62cd617019e31c689eb4326591a07e9d58d31af (patch)
treee022796068d73549c1cf1f3dc502289c63af0b40 /include/nms.pm
parentfc1b728836d79156655672c7d625ae5b24434cde (diff)
Proper disconnect handling for smanagrun
Diffstat (limited to 'include/nms.pm')
-rwxr-xr-xinclude/nms.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/nms.pm b/include/nms.pm
index e6f4d6c..c61cec7 100755
--- a/include/nms.pm
+++ b/include/nms.pm
@@ -148,9 +148,13 @@ sub switch_timeout {
return ('Set timeout to ' . $timeout);
}
-sub switch_disconnect {
- my ($conn) = @_;
- $conn->close;
+sub switch_disconnect($) {
+ my ($struct) = @_;
+ my $conn = $struct->{telnet};
+ $conn->close();
+ if ($struct->{pid}) {
+ waitpid($struct->{pid}, 0);
+ }
}
sub snmp_open_session {