diff options
author | 2003-06-04 00:24:16 +0000 | |
---|---|---|
committer | 2003-06-04 00:24:16 +0000 | |
commit | b416634c15fe9474593849530ae6232b5e3c890b (patch) | |
tree | 9cf52c38e0857ef7a60d2a33ba6e7856a1741942 | |
parent | simplify some tty handling code: (diff) | |
download | wireguard-openbsd-b416634c15fe9474593849530ae6232b5e3c890b.tar.xz wireguard-openbsd-b416634c15fe9474593849530ae6232b5e3c890b.zip |
Fix mergo that resulted in 2 copies of the handle_signal() function.
-rw-r--r-- | distrib/special/more/more.c | 72 |
1 files changed, 2 insertions, 70 deletions
diff --git a/distrib/special/more/more.c b/distrib/special/more/more.c index 064d564142d..294707bff6d 100644 --- a/distrib/special/more/more.c +++ b/distrib/special/more/more.c @@ -1,4 +1,4 @@ -/* $OpenBSD: more.c,v 1.17 2003/06/04 00:18:39 millert Exp $ */ +/* $OpenBSD: more.c,v 1.18 2003/06/04 00:24:16 millert Exp $ */ /*- * Copyright (c) 1980 The Regents of the University of California. @@ -39,7 +39,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)more.c 5.28 (Berkeley) 3/1/93"; #else -static const char rcsid[] = "$OpenBSD: more.c,v 1.17 2003/06/04 00:18:39 millert Exp $"; +static const char rcsid[] = "$OpenBSD: more.c,v 1.18 2003/06/04 00:24:16 millert Exp $"; #endif #endif /* not lint */ @@ -1580,74 +1580,6 @@ handle_signal(int sig) } int -handle_signal(int sig) -{ - int ch = -1; - - signo = 0; - - switch (sig) { - case SIGQUIT: - if (!inwait) { - putchar('\n'); - if (startup) - Pause++; - } else if (!dum_opt && notell) { - write(STDERR_FILENO, QUIT_IT, - sizeof(QUIT_IT) - 1); - promptlen += sizeof(QUIT_IT) - 1; - notell = 0; - } - break; - case SIGTSTP: - case SIGTTIN: - case SIGTTOU: - /* XXX - should use saved values instead of SIG_DFL */ - sa.sa_handler = SIG_DFL; - sa.sa_flags = SA_RESTART; - (void)sigaction(SIGTSTP, &sa, NULL); - (void)sigaction(SIGTTIN, &sa, NULL); - (void)sigaction(SIGTTOU, &sa, NULL); - reset_tty(); - kill(getpid(), sig); - - sa.sa_handler = onsignal; - sa.sa_flags = 0; - (void)sigaction(SIGTSTP, &sa, NULL); - (void)sigaction(SIGTTIN, &sa, NULL); - (void)sigaction(SIGTTOU, &sa, NULL); - set_tty(); - if (!no_intty) - ch = '\f'; /* force redraw */ - break; - case SIGINT: - end_it(); - break; - case SIGWINCH: { - struct winsize win; - - if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != 0) - break; - if (win.ws_row != 0) { - Lpp = win.ws_row; - nscroll = Lpp/2 - 1; - if (nscroll <= 0) - nscroll = 1; - dlines = Lpp - (noscroll ? 1 : 2); - } - if (win.ws_col != 0) - Mcol = win.ws_col; - if (!no_intty) - ch = '\f'; /* force redraw */ - break; - } default: - /* NOTREACHED */ - break; - } - return (ch); -} - -int readch(void) { int ch; |