projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
purge pending output when fielding SIGINT (signal handling still
[unix-history]
/
usr
/
src
/
usr.bin
/
more
/
signal.c
diff --git
a/usr/src/usr.bin/more/signal.c
b/usr/src/usr.bin/more/signal.c
index
e742748
..
2cd56bf
100644
(file)
--- a/
usr/src/usr.bin/more/signal.c
+++ b/
usr/src/usr.bin/more/signal.c
@@
-18,7
+18,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char sccsid[] = "@(#)signal.c 5.
5
(Berkeley) %G%";
+static char sccsid[] = "@(#)signal.c 5.
6
(Berkeley) %G%";
#endif /* not lint */
/*
#endif /* not lint */
/*
@@
-93,6
+93,14
@@
winch()
#endif
#endif
#endif
#endif
+static int
+purgeandquit()
+{
+
+ purge(); /* purge buffered output */
+ quit();
+}
+
/*
* Set up the signal handlers.
*/
/*
* Set up the signal handlers.
*/
@@
-106,7
+114,7
@@
init_signals(on)
/*
* Set signal handlers.
*/
/*
* Set signal handlers.
*/
- (void)signal(SIGINT, quit);
+ (void)signal(SIGINT,
purgeand
quit);
#ifdef SIGTSTP
(void)signal(SIGTSTP, stop);
#endif
#ifdef SIGTSTP
(void)signal(SIGTSTP, stop);
#endif