|
@@ -20,6 +20,7 @@ const char *SHUT_DOWN = "scripts/bringDownTestServers.sh";
|
|
|
const int INPUT_BUFFER_LEN = 133;
|
|
|
char whichTest[INPUT_BUFFER_LEN];
|
|
|
int currPid = 0;
|
|
|
+bool stopSignaled = false;
|
|
|
|
|
|
void exitInterruptHandler(int signum)
|
|
|
{
|
|
@@ -46,13 +47,22 @@ void exitInterruptHandler(int signum)
|
|
|
exit(signum);
|
|
|
}
|
|
|
|
|
|
+void gentleInterruptHandler(int signum)
|
|
|
+{
|
|
|
+ std::cout << "Upcoming stop signal received." << std::endl;
|
|
|
+ std::cout << "After the current run is done, the program will quit." << std::endl;
|
|
|
+
|
|
|
+ stopSignaled = true;
|
|
|
+}
|
|
|
+
|
|
|
int main(int argc, char* argv[])
|
|
|
{
|
|
|
signal(SIGINT, exitInterruptHandler);
|
|
|
+ signal(SIGTSTP, gentleInterruptHandler);
|
|
|
|
|
|
char inputBuffer[INPUT_BUFFER_LEN];
|
|
|
std::ifstream configFile("cfg/queue.cfg");
|
|
|
- while (!configFile.eof())
|
|
|
+ while (!stopSignaled && !configFile.eof())
|
|
|
{
|
|
|
configFile.getline(inputBuffer, INPUT_BUFFER_LEN);
|
|
|
if (strlen(inputBuffer) > 0)
|