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:
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user