X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_getch.c;h=773ed15763800434decaece70e8414d6bea59049;hp=6f4f3c54e5b8e8b254eb435e987752ea7543a771;hb=41677b308e138027b7e435f741ee7fe5651237b0;hpb=92e187a3459ab7ce1613a3684ca6642447c73620 diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index 6f4f3c54..773ed157 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.116 2010/05/01 22:40:47 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.118 2010/05/15 21:31:12 tom Exp $") #include @@ -264,7 +264,14 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) ch = buf; #else unsigned char c2 = 0; +# if USE_PTHREADS_EINTR + if ((pthread_self) && (pthread_kill) && (pthread_equal)) + _nc_globals.read_thread = pthread_self(); +# endif n = read(sp->_ifd, &c2, 1); +#if USE_PTHREADS_EINTR + _nc_globals.read_thread = 0; +#endif ch = c2; #endif } @@ -279,7 +286,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) * We don't want this difference to show. This piece of code * tries to make it look like we always have restarting signals. */ - if (n <= 0 && errno == EINTR) + if (n <= 0 && errno == EINTR +# if USE_PTHREADS_EINTR + && (_nc_globals.have_sigwinch == 0) +# endif + ) goto again; #endif