added "more" command
[unix-history] / usr / src / usr.bin / window / wwsuspend.c
index 6ac20c0..c9f8abe 100644 (file)
@@ -1,22 +1,28 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwsuspend.c 2.1 83/07/30";
+static char sccsid[] = "@(#)wwsuspend.c        3.7 %G%";
 #endif
 
 #endif
 
-#include "ww.h"
-#include <signal.h>
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved.  Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
+ */
 
 
-#define mask(s)        (1<<(SIG/**/s-1))
+#include "ww.h"
+#include "tt.h"
+#include <sys/signal.h>
 
 wwsuspend()
 {
 
 wwsuspend()
 {
-       int oldmask;
+       int (*oldsig)();
 
 
-       oldmask = sigblock(mask(TSTP));
+       oldsig = signal(SIGTSTP, SIG_IGN);
        wwend();
        wwend();
-       sigsetmask(sigblock(0) & ~mask(TSTP));
-       kill(0, SIGTSTP);
-       sigblock(mask(TSTP));
-       wwsettty(0, &wwnewtty);
-       Winit(2, 1);
-       sigsetmask(oldmask);
+       (void) signal(SIGTSTP, SIG_DFL);
+       (void) kill(0, SIGTSTP);
+       (void) signal(SIGTSTP, SIG_IGN);
+       (void) wwsettty(0, &wwnewtty, &wwoldtty);
+       (*tt.tt_init)();
+       wwredraw();
+       (void) signal(SIGTSTP, oldsig);
 }
 }