* src/TestOperations.cc (generateBuchiAutomaton): Forward SIGINT

and SIGQUIT.
* src/ExternalTranslator.cc (ExternalTranslator::translate): Likewise.
* src/main.cc (main): Do not intercept SIGINT in
non-interactive runs.
This commit is contained in:
Alexandre Duret-Lutz 2003-07-29 13:06:53 +00:00
parent ea90d2f8be
commit 48c03b89b8
7 changed files with 593 additions and 561 deletions

View file

@ -1,4 +1,12 @@
2003-07-13 Alexandre Duret-Lutz <adl@gnu.org>
2003-07-29 Alexandre Duret-Lutz <aduret@src.lip6.fr>
* src/TestOperations.cc (generateBuchiAutomaton): Forward SIGINT
and SIGQUIT.
* src/ExternalTranslator.cc (ExternalTranslator::translate): Likewise.
* src/main.cc (main): Do not intercept SIGINT in
non-interactive runs.
2003-07-13 Alexandre Duret-Lutz <aduret@src.lip6.fr>
* doc/lbtt.texi: Never use @-commands in @node names, recent Texinfo
versions are stricter on this.

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 1999, 2000, 2001, 2002
* Copyright (C) 1999, 2000, 2001, 2002, 2003
* Heikki Tauriainen <Heikki.Tauriainen@hut.fi>
*
* This program is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 1999, 2000, 2001, 2002
* Copyright (C) 1999, 2000, 2001, 2002, 2003
* Heikki Tauriainen <Heikki.Tauriainen@hut.fi>
*
* This program is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 1999, 2000, 2001, 2002
* Copyright (C) 1999, 2000, 2001, 2002, 2003
* Heikki Tauriainen <Heikki.Tauriainen@hut.fi>
*
* This program is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 1999, 2000, 2001, 2002
* Copyright (C) 1999, 2000, 2001, 2002, 2003
* Heikki Tauriainen <Heikki.Tauriainen@hut.fi>
*
* This program is free software; you can redistribute it and/or
@ -22,6 +22,7 @@
#endif /* __GNUC__ */
#include <config.h>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <sys/stat.h>
@ -128,7 +129,17 @@ void ExternalTranslator::translate
+ commandLine(external_program_input_file.getName(),
external_program_output_file.getName());
if (!execSuccess(system(command_line.c_str())))
int exitcode = system(command_line.c_str());
/*
* system() blocks SIGINT and SIGQUIT. If the child was killed
* by such a signal, forward the signal to the current process.
*/
if (WIFSIGNALED(exitcode) &&
(WTERMSIG(exitcode) == SIGINT || WTERMSIG(exitcode) == SIGQUIT))
raise(WTERMSIG(exitcode));
if (!execSuccess(exitcode))
throw ExecFailedException(command_line_arguments[2]);
parseAutomaton(external_program_output_file.getName(), filename);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 1999, 2000, 2001, 2002
* Copyright (C) 1999, 2000, 2001, 2002, 2003
* Heikki Tauriainen <Heikki.Tauriainen@hut.fi>
*
* This program is free software; you can redistribute it and/or
@ -22,6 +22,7 @@
#endif /* __GNUC__ */
#include <config.h>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <sys/times.h>
@ -851,6 +852,17 @@ void generateBuchiAutomaton
if (exitcode != 0)
{
/*
* system() blocks SIGINT and SIGQUIT. If the child was killed
* by such a signal, forward the signal to the current process.
* If lbtt is interactive, SIGINT will be handled as a user
* break. If lbtt is non-interactive, SIGINT will kill lbtt.
* This is what we expect when hitting C-c while lbtt is running.
*/
if (WIFSIGNALED(exitcode) &&
(WTERMSIG(exitcode) == SIGINT || WTERMSIG(exitcode) == SIGQUIT))
raise(WTERMSIG(exitcode));
ExecFailedException e;
e.changeMessage("Execution of `" + *(algorithm.path_to_program)
+ "' failed"

View file

@ -704,6 +704,7 @@ int main(int argc, char* argv[])
configuration.print(cout);
user_break = false;
if (configuration.global_options.interactive != Configuration::NEVER)
signal(SIGINT, breakHandler);
#ifdef HAVE_OBSTACK_H