]> thyrsus.com Git - morse-classic.git/commitdiff
Better SIGTSTP handling.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 25 Jan 2005 07:49:58 +0000 (07:49 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 25 Jan 2005 07:49:58 +0000 (07:49 +0000)
morse.d/morse.c

index 5bbe3457715f671cdd339b8234f74fdc3198a38e..213c462e34117c78c28d8a5919dfb6e2336a42cf 100644 (file)
@@ -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)