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
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

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