summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-03-02 10:18:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-03-02 10:18:50 +0000
commitaef1460fb26d62736c1bc98d523e1bd996353258 (patch)
tree535143e2c6d9540861f72d90107b23c365efdc4f /gnu/usr.bin
parent9539501b8177df17a106ba8572a45a1e29b8d4c2 (diff)
signal handler repairs; phil@cs.wwu.edu
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/bc/bc/execute.c9
-rw-r--r--gnu/usr.bin/bc/bc/main.c2
2 files changed, 5 insertions, 6 deletions
diff --git a/gnu/usr.bin/bc/bc/execute.c b/gnu/usr.bin/bc/bc/execute.c
index c8f3df26135..0ef9bb98795 100644
--- a/gnu/usr.bin/bc/bc/execute.c
+++ b/gnu/usr.bin/bc/bc/execute.c
@@ -41,8 +41,6 @@ stop_execution (sig)
int sig;
{
had_sigint = TRUE;
- printf ("\n");
- rt_error ("interrupted execution");
}
@@ -87,10 +85,11 @@ execute ()
if (interactive)
{
signal (SIGINT, stop_execution);
- had_sigint = FALSE;
}
- while (pc.pc_addr < functions[pc.pc_func].f_code_size && !runtime_error)
+ had_sigint = FALSE;
+ while (pc.pc_addr < functions[pc.pc_func].f_code_size
+ && !runtime_error && !had_sigint)
{
inst = byte(&pc);
@@ -543,7 +542,7 @@ execute ()
{
signal (SIGINT, use_quit);
if (had_sigint)
- printf ("Interruption completed.\n");
+ printf ("\ninterrupted execution.\n");
}
}
diff --git a/gnu/usr.bin/bc/bc/main.c b/gnu/usr.bin/bc/bc/main.c
index 29a334fb0fb..87a9feb3af2 100644
--- a/gnu/usr.bin/bc/bc/main.c
+++ b/gnu/usr.bin/bc/bc/main.c
@@ -325,6 +325,6 @@ void
use_quit (sig)
int sig;
{
- printf ("\n(interrupt) use quit to exit.\n");
+ write (1, "\n(interrupt) use quit to exit.\n", 31);
signal (SIGINT, use_quit);
}