Ignore SIGHUP termination in ssh_node

Sometimes the command appears to complete and terminate with a SIGHUP
instead of the proper return value.
This commit is contained in:
Markus Mäkelä
2019-05-22 09:38:04 +03:00
parent b294acf276
commit 365efb9d3a

View File

@ -5,6 +5,7 @@
#include <future> #include <future>
#include <functional> #include <functional>
#include <algorithm> #include <algorithm>
#include <signal.h>
#include "envv.h" #include "envv.h"
@ -189,8 +190,14 @@ int Nodes::ssh_node(int node, const char* ssh, bool sudo)
{ {
return WEXITSTATUS(rc); return WEXITSTATUS(rc);
} }
else if (WIFSIGNALED(rc) && WTERMSIG(rc) == SIGHUP)
{
// SIGHUP appears to happen for SSH connections
return 0;
}
else else
{ {
std::cout << strerror(errno) << std::endl;
return 256; return 256;
} }
} }