PR lib/53615
getch() and get_wch() should return KEY_RESIZE when interrupted by SIGWINCH. OK roy
This commit is contained in:
parent
b2d60dd6a2
commit
88ccf2cadc
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: get_wch.c,v 1.14 2017/01/31 09:17:53 roy Exp $ */
|
/* $NetBSD: get_wch.c,v 1.15 2018/09/18 22:46:18 rin Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005 The NetBSD Foundation Inc.
|
* Copyright (c) 2005 The NetBSD Foundation Inc.
|
||||||
|
@ -36,9 +36,10 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
__RCSID("$NetBSD: get_wch.c,v 1.14 2017/01/31 09:17:53 roy Exp $");
|
__RCSID("$NetBSD: get_wch.c,v 1.15 2018/09/18 22:46:18 rin Exp $");
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -596,7 +597,12 @@ wget_wch(WINDOW *win, wint_t *ch)
|
||||||
|
|
||||||
if (ferror(infd)) {
|
if (ferror(infd)) {
|
||||||
clearerr(infd);
|
clearerr(infd);
|
||||||
return ERR;
|
if (errno == EINTR && _cursesi_screen->resized) {
|
||||||
|
_cursesi_screen->resized = 0;
|
||||||
|
*ch = KEY_RESIZE;
|
||||||
|
return KEY_CODE_YES;
|
||||||
|
} else
|
||||||
|
return ERR;
|
||||||
} else {
|
} else {
|
||||||
ret = c;
|
ret = c;
|
||||||
inp = c;
|
inp = c;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: getch.c,v 1.65 2017/01/31 09:17:53 roy Exp $ */
|
/* $NetBSD: getch.c,v 1.66 2018/09/18 22:46:18 rin Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1981, 1993, 1994
|
* Copyright (c) 1981, 1993, 1994
|
||||||
|
@ -34,10 +34,11 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)getch.c 8.2 (Berkeley) 5/4/94";
|
static char sccsid[] = "@(#)getch.c 8.2 (Berkeley) 5/4/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: getch.c,v 1.65 2017/01/31 09:17:53 roy Exp $");
|
__RCSID("$NetBSD: getch.c,v 1.66 2018/09/18 22:46:18 rin Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -889,7 +890,11 @@ wgetch(WINDOW *win)
|
||||||
|
|
||||||
if (ferror(infd)) {
|
if (ferror(infd)) {
|
||||||
clearerr(infd);
|
clearerr(infd);
|
||||||
inp = ERR;
|
if (errno == EINTR && _cursesi_screen->resized) {
|
||||||
|
_cursesi_screen->resized = 0;
|
||||||
|
inp = KEY_RESIZE;
|
||||||
|
} else
|
||||||
|
inp = ERR;
|
||||||
} else {
|
} else {
|
||||||
inp = c;
|
inp = c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue