From: Eric S. Raymond Date: Tue, 25 Jan 2005 07:49:58 +0000 (+0000) Subject: Better SIGTSTP handling. X-Git-Tag: 2.1~4 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=55ebb769ede30698442b41480279770c05840337;p=morse-classic.git Better SIGTSTP handling. --- diff --git a/morse.d/morse.c b/morse.d/morse.c index 5bbe345..213c462 100644 --- a/morse.d/morse.c +++ b/morse.d/morse.c @@ -631,11 +631,11 @@ struct sigaction handler; } /* - * Do .25 seconds of silence initially to give the workstation time to + * Do 0.25 seconds of silence initially to give the workstation time to * get settled after the stress of starting this program and opening * up everything. */ - tone (frequency, .25, 0.); + tone (frequency, 0.25, 0); toneflush (); if (typeaway) @@ -1781,9 +1781,11 @@ cleanup (void) static void suspend (int sig) { -#ifdef SIGTSTP - sigset (SIGTSTP, suspend); */ -#endif /* SIGTSTP */ + struct sigaction handler; + + handler.sa_mask = handler.sa_flags = 0; + handler.sa_handler = suspend; + sigaction (SIGTSTP, &handler, NULL); cleanup (); kill (getpid (), SIGSTOP); if (termopen)