ANSI
[unix-history] / usr / src / usr.bin / window / wwrint.c
index d4c305f..959a36a 100644 (file)
@@ -1,22 +1,31 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Edward Wang at The University of California, Berkeley.
+ *
+ * %sccs.include.redist.c%
+ */
+
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwrint.c    3.2 84/04/16";
-#endif
+static char sccsid[] = "@(#)wwrint.c   3.11 (Berkeley) %G%";
+#endif /* not lint */
 
 #include "ww.h"
 #include <fcntl.h>
 
 #include "ww.h"
 #include <fcntl.h>
-#include <sys/signal.h>
 
 /*
  * Tty input interrupt handler.
  * (1) Read input into buffer (wwib*).
 
 /*
  * Tty input interrupt handler.
  * (1) Read input into buffer (wwib*).
- * (2) If the flag wwsetjmp is true, do longjmp(wwjmpbuf) for asyncronous
- *     actions, and to avoid race conditions, clear wwsetjmp.
+ * (2) Set the interrupt flag if anything is read.
  * Currently, the last is used to get out of the blocking
  * select() in wwiomux().
  * To avoid race conditions, we only modify wwibq in here, except
  * when the buffer is empty; and everywhere else, we only change wwibp.
  * It should be completely safe.
  */
  * Currently, the last is used to get out of the blocking
  * select() in wwiomux().
  * To avoid race conditions, we only modify wwibq in here, except
  * when the buffer is empty; and everywhere else, we only change wwibp.
  * It should be completely safe.
  */
+void
 wwrint()
 {
        register n;
 wwrint()
 {
        register n;
@@ -30,13 +39,9 @@ wwrint()
        if (n > 0) {
                wwibq += n;
                wwnreadc += n;
        if (n > 0) {
                wwibq += n;
                wwnreadc += n;
+               wwsetintr();
        } else if (n == 0)
                wwnreadz++;
        else
                wwnreade++;
        } else if (n == 0)
                wwnreadz++;
        else
                wwnreade++;
-       if (wwinterrupt() && wwsetjmp) {
-               wwsetjmp = 0;
-               (void) sigsetmask(sigblock(0) & ~sigmask(SIGIO));
-               longjmp(wwjmpbuf, 1);
-       }
 }
 }