From ad884ba36cf8d5e2dd3348b4b81d62d82a5a11b24ba73d17cc054cb10fccc39e Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 18 Mar 2010 15:11:04 +0000 Subject: [PATCH 1/5] Updating link to change in openSUSE:Factory/ncurses revision 28.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/ncurses?expand=0&rev=ff4010b5386522b68465eea3c8811101 From fd98ed7ee36dcc66ea4cb6a8a5890055c83e4c16a7949dd240a0ee057ffeaaf2 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 7 May 2010 17:12:22 +0000 Subject: [PATCH 2/5] . OBS-URL: https://build.opensuse.org/package/show/Base:System/ncurses?expand=0&rev=23 --- ncurses-5.7-pthread.dif | 157 ++++++++++++++++++++++++++++++++++++++++ ncurses.changes | 6 ++ ncurses.spec | 2 + 3 files changed, 165 insertions(+) create mode 100644 ncurses-5.7-pthread.dif diff --git a/ncurses-5.7-pthread.dif b/ncurses-5.7-pthread.dif new file mode 100644 index 0000000..db39268 --- /dev/null +++ b/ncurses-5.7-pthread.dif @@ -0,0 +1,157 @@ +--- ncurses/base/lib_getch.c ++++ ncurses/base/lib_getch.c 2010-05-07 19:02:11.222924328 +0200 +@@ -264,7 +264,14 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_e + ch = buf; + #else + unsigned char c2 = 0; ++# ifdef USE_EINTR ++ if ((pthread_self) && (pthread_kill) && (pthread_equal)) ++ _nc_globals.read_thread = pthread_self(); ++# endif + n = read(sp->_ifd, &c2, 1); ++#ifdef USE_EINTR ++ _nc_globals.read_thread = 0; ++#endif + ch = c2; + #endif + } +@@ -279,7 +286,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_e + * 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 ++# ifdef USE_EINTR ++ && (_nc_globals.have_sigwinch == 0) ++# endif ++ ) + goto again; + #endif + +--- ncurses/base/lib_mouse.c ++++ ncurses/base/lib_mouse.c 2010-05-07 19:01:35.658924370 +0200 +@@ -838,6 +838,10 @@ _nc_mouse_inline(SCREEN *sp) + * Wheel mice may return buttons 4 and 5 when the wheel is turned. + * We encode those as button presses. + */ ++# ifdef USE_EINTR ++ if ((pthread_self) && (pthread_kill) && (pthread_equal)) ++ _nc_globals.read_thread = pthread_self(); ++# endif + for (grabbed = 0; grabbed < 3; grabbed += (size_t) res) { + + /* For VIO mouse we add extra bit 64 to disambiguate button-up. */ +@@ -849,6 +853,9 @@ _nc_mouse_inline(SCREEN *sp) + if (res == -1) + break; + } ++#ifdef USE_EINTR ++ _nc_globals.read_thread = 0; ++#endif + kbuf[3] = '\0'; + + TR(TRACE_IEVENT, +--- ncurses/curses.priv.h ++++ ncurses/curses.priv.h 2010-05-07 18:51:15.686924218 +0200 +@@ -448,6 +448,7 @@ extern NCURSES_EXPORT(int) _nc_mutex_unl + #endif + + #ifdef USE_PTHREADS ++# define USE_EINTR + # if USE_WEAK_SYMBOLS + weak_symbol(pthread_sigmask); + weak_symbol(pthread_self); +@@ -471,6 +472,38 @@ extern NCURSES_EXPORT(int) _nc_sigprocma + + #else /* !USE_PTHREADS */ + ++#if defined(linux) && USE_SIGWINCH ++# define USE_EINTR ++#endif ++ ++#ifdef USE_EINTR ++#if defined(__GNUC__) ++# if defined __USE_ISOC99 ++# define _cat_pragma(exp) _Pragma(#exp) ++# define _weak_pragma(exp) _cat_pragma(weak name) ++# else ++# define _weak_pragma(exp) ++# endif ++# define _declare(name) __extension__ extern __typeof__(name) name ++# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) ++#endif ++ ++#include ++weak_symbol(pthread_sigmask); ++weak_symbol(pthread_kill); ++weak_symbol(pthread_self); ++weak_symbol(pthread_equal); ++static inline int _nc_sigprocmask(int how, const sigset_t *newmask, sigset_t *oldmask) ++{ ++ if ((pthread_sigmask)) ++ return pthread_sigmask(how, newmask, oldmask); ++ else ++ return sigprocmask(how, newmask, oldmask); ++} ++# undef sigprocmask ++# define sigprocmask _nc_sigprocmask ++#endif /* USE_EINTR */ ++ + #define _nc_init_pthreads() /* nothing */ + #define _nc_mutex_init(obj) /* nothing */ + +@@ -798,6 +831,9 @@ typedef struct { + int use_pthreads; + #define _nc_use_pthreads _nc_globals.use_pthreads + #endif ++#ifdef USE_EINTR ++ pthread_t read_thread; /* The reading thread */ ++#endif + } NCURSES_GLOBALS; + + extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; +--- ncurses/tinfo/lib_data.c ++++ ncurses/tinfo/lib_data.c 2010-05-07 18:46:59.706924518 +0200 +@@ -193,6 +193,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_ + 0, /* nested_tracef */ + 0, /* use_pthreads */ + #endif ++#ifdef USE_EINTR ++ 0, /* read_thread */ ++#endif + }; + + #define STACK_FRAME_0 { { 0 }, 0 } +--- ncurses/tinfo/tinfo_driver.c 2009-10-31 21:32:01.000000000 +0100 ++++ ncurses/tinfo/tinfo_driver.c 2010-05-07 19:01:44.686924794 +0200 +@@ -1248,7 +1248,14 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, i + assert(buf); + SetSP(); + ++# ifdef USE_EINTR ++ if ((pthread_self) && (pthread_kill) && (pthread_equal)) ++ _nc_globals.read_thread = pthread_self(); ++# endif + n = read(sp->_ifd, &c2, 1); ++#ifdef USE_EINTR ++ _nc_globals.read_thread = 0; ++#endif + *buf = (int) c2; + return n; + } +--- ncurses/tty/lib_tstp.c ++++ ncurses/tty/lib_tstp.c 2010-05-07 18:55:04.326924859 +0200 +@@ -286,6 +286,13 @@ static void + sigwinch(int sig GCC_UNUSED) + { + _nc_globals.have_sigwinch = 1; ++# ifdef USE_EINTR ++ if (_nc_globals.read_thread) { ++ if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) ++ pthread_kill(_nc_globals.read_thread, SIGWINCH); ++ _nc_globals.read_thread = 0; ++ } ++# endif + } + #endif /* USE_SIGWINCH */ + diff --git a/ncurses.changes b/ncurses.changes index 00341a8..5a153f7 100644 --- a/ncurses.changes +++ b/ncurses.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 7 19:09:22 CEST 2010 - werner@suse.de + +- Ad workaround to enforce that the terminal rading thread will + interrupted by SIGWINCH (bnc#540571) + ------------------------------------------------------------------- Fri Jan 15 14:29:20 CET 2010 - werner@suse.de diff --git a/ncurses.spec b/ncurses.spec index b44c5f0..6984e41 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -49,6 +49,7 @@ Patch3: ncurses-5.7-overwrite.dif Patch4: ncurses-5.7-tack.dif Patch5: ncurses-5.7-gpm.dif Patch6: ncurses-5.6-fallback.dif +Patch7: ncurses-5.7-pthread.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -271,6 +272,7 @@ mv tack-* tack %patch -P 4 -p0 -b .hs %patch -P 5 -p0 -b .gpm %patch -P 6 -p0 -b .fb +%patch -P 7 -p0 %patch -P 0 -p0 %build From ca95f2fd94d39199760da196e78dd36c6ef6811754074901ded512c1ba35bc67 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 7 May 2010 17:22:34 +0000 Subject: [PATCH 3/5] . OBS-URL: https://build.opensuse.org/package/show/Base:System/ncurses?expand=0&rev=24 --- ncurses-5.7-pthread.dif | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ncurses-5.7-pthread.dif b/ncurses-5.7-pthread.dif index db39268..e15366e 100644 --- a/ncurses-5.7-pthread.dif +++ b/ncurses-5.7-pthread.dif @@ -53,15 +53,18 @@ TR(TRACE_IEVENT, --- ncurses/curses.priv.h +++ ncurses/curses.priv.h 2010-05-07 18:51:15.686924218 +0200 -@@ -448,6 +448,7 @@ extern NCURSES_EXPORT(int) _nc_mutex_unl +@@ -448,8 +448,10 @@ extern NCURSES_EXPORT(int) _nc_mutex_unl #endif #ifdef USE_PTHREADS +# define USE_EINTR # if USE_WEAK_SYMBOLS weak_symbol(pthread_sigmask); ++weak_symbol(pthread_kill); weak_symbol(pthread_self); -@@ -471,6 +472,38 @@ extern NCURSES_EXPORT(int) _nc_sigprocma + weak_symbol(pthread_equal); + weak_symbol(pthread_mutex_init); +@@ -471,6 +473,38 @@ extern NCURSES_EXPORT(int) _nc_sigprocma #else /* !USE_PTHREADS */ @@ -100,7 +103,7 @@ #define _nc_init_pthreads() /* nothing */ #define _nc_mutex_init(obj) /* nothing */ -@@ -798,6 +831,9 @@ typedef struct { +@@ -798,6 +832,9 @@ typedef struct { int use_pthreads; #define _nc_use_pthreads _nc_globals.use_pthreads #endif From 690cf32952e338ce1268b99d77f4eae8053e4e414f7314d5e051344f02c06e1d Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Tue, 25 May 2010 08:26:15 +0000 Subject: [PATCH 4/5] Accepting request 39665 from Base:System checked in (request 39665) OBS-URL: https://build.opensuse.org/request/show/39665 OBS-URL: https://build.opensuse.org/package/show/Base:System/ncurses?expand=0&rev=25 --- ncurses-5.7-pthread.dif | 160 ---------------------------------------- ncurses.changes | 6 -- ncurses.spec | 2 - 3 files changed, 168 deletions(-) delete mode 100644 ncurses-5.7-pthread.dif diff --git a/ncurses-5.7-pthread.dif b/ncurses-5.7-pthread.dif deleted file mode 100644 index e15366e..0000000 --- a/ncurses-5.7-pthread.dif +++ /dev/null @@ -1,160 +0,0 @@ ---- ncurses/base/lib_getch.c -+++ ncurses/base/lib_getch.c 2010-05-07 19:02:11.222924328 +0200 -@@ -264,7 +264,14 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_e - ch = buf; - #else - unsigned char c2 = 0; -+# ifdef USE_EINTR -+ if ((pthread_self) && (pthread_kill) && (pthread_equal)) -+ _nc_globals.read_thread = pthread_self(); -+# endif - n = read(sp->_ifd, &c2, 1); -+#ifdef USE_EINTR -+ _nc_globals.read_thread = 0; -+#endif - ch = c2; - #endif - } -@@ -279,7 +286,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_e - * 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 -+# ifdef USE_EINTR -+ && (_nc_globals.have_sigwinch == 0) -+# endif -+ ) - goto again; - #endif - ---- ncurses/base/lib_mouse.c -+++ ncurses/base/lib_mouse.c 2010-05-07 19:01:35.658924370 +0200 -@@ -838,6 +838,10 @@ _nc_mouse_inline(SCREEN *sp) - * Wheel mice may return buttons 4 and 5 when the wheel is turned. - * We encode those as button presses. - */ -+# ifdef USE_EINTR -+ if ((pthread_self) && (pthread_kill) && (pthread_equal)) -+ _nc_globals.read_thread = pthread_self(); -+# endif - for (grabbed = 0; grabbed < 3; grabbed += (size_t) res) { - - /* For VIO mouse we add extra bit 64 to disambiguate button-up. */ -@@ -849,6 +853,9 @@ _nc_mouse_inline(SCREEN *sp) - if (res == -1) - break; - } -+#ifdef USE_EINTR -+ _nc_globals.read_thread = 0; -+#endif - kbuf[3] = '\0'; - - TR(TRACE_IEVENT, ---- ncurses/curses.priv.h -+++ ncurses/curses.priv.h 2010-05-07 18:51:15.686924218 +0200 -@@ -448,8 +448,10 @@ extern NCURSES_EXPORT(int) _nc_mutex_unl - #endif - - #ifdef USE_PTHREADS -+# define USE_EINTR - # if USE_WEAK_SYMBOLS - weak_symbol(pthread_sigmask); -+weak_symbol(pthread_kill); - weak_symbol(pthread_self); - weak_symbol(pthread_equal); - weak_symbol(pthread_mutex_init); -@@ -471,6 +473,38 @@ extern NCURSES_EXPORT(int) _nc_sigprocma - - #else /* !USE_PTHREADS */ - -+#if defined(linux) && USE_SIGWINCH -+# define USE_EINTR -+#endif -+ -+#ifdef USE_EINTR -+#if defined(__GNUC__) -+# if defined __USE_ISOC99 -+# define _cat_pragma(exp) _Pragma(#exp) -+# define _weak_pragma(exp) _cat_pragma(weak name) -+# else -+# define _weak_pragma(exp) -+# endif -+# define _declare(name) __extension__ extern __typeof__(name) name -+# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) -+#endif -+ -+#include -+weak_symbol(pthread_sigmask); -+weak_symbol(pthread_kill); -+weak_symbol(pthread_self); -+weak_symbol(pthread_equal); -+static inline int _nc_sigprocmask(int how, const sigset_t *newmask, sigset_t *oldmask) -+{ -+ if ((pthread_sigmask)) -+ return pthread_sigmask(how, newmask, oldmask); -+ else -+ return sigprocmask(how, newmask, oldmask); -+} -+# undef sigprocmask -+# define sigprocmask _nc_sigprocmask -+#endif /* USE_EINTR */ -+ - #define _nc_init_pthreads() /* nothing */ - #define _nc_mutex_init(obj) /* nothing */ - -@@ -798,6 +832,9 @@ typedef struct { - int use_pthreads; - #define _nc_use_pthreads _nc_globals.use_pthreads - #endif -+#ifdef USE_EINTR -+ pthread_t read_thread; /* The reading thread */ -+#endif - } NCURSES_GLOBALS; - - extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; ---- ncurses/tinfo/lib_data.c -+++ ncurses/tinfo/lib_data.c 2010-05-07 18:46:59.706924518 +0200 -@@ -193,6 +193,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_ - 0, /* nested_tracef */ - 0, /* use_pthreads */ - #endif -+#ifdef USE_EINTR -+ 0, /* read_thread */ -+#endif - }; - - #define STACK_FRAME_0 { { 0 }, 0 } ---- ncurses/tinfo/tinfo_driver.c 2009-10-31 21:32:01.000000000 +0100 -+++ ncurses/tinfo/tinfo_driver.c 2010-05-07 19:01:44.686924794 +0200 -@@ -1248,7 +1248,14 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, i - assert(buf); - SetSP(); - -+# ifdef USE_EINTR -+ if ((pthread_self) && (pthread_kill) && (pthread_equal)) -+ _nc_globals.read_thread = pthread_self(); -+# endif - n = read(sp->_ifd, &c2, 1); -+#ifdef USE_EINTR -+ _nc_globals.read_thread = 0; -+#endif - *buf = (int) c2; - return n; - } ---- ncurses/tty/lib_tstp.c -+++ ncurses/tty/lib_tstp.c 2010-05-07 18:55:04.326924859 +0200 -@@ -286,6 +286,13 @@ static void - sigwinch(int sig GCC_UNUSED) - { - _nc_globals.have_sigwinch = 1; -+# ifdef USE_EINTR -+ if (_nc_globals.read_thread) { -+ if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) -+ pthread_kill(_nc_globals.read_thread, SIGWINCH); -+ _nc_globals.read_thread = 0; -+ } -+# endif - } - #endif /* USE_SIGWINCH */ - diff --git a/ncurses.changes b/ncurses.changes index 5a153f7..00341a8 100644 --- a/ncurses.changes +++ b/ncurses.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Fri May 7 19:09:22 CEST 2010 - werner@suse.de - -- Ad workaround to enforce that the terminal rading thread will - interrupted by SIGWINCH (bnc#540571) - ------------------------------------------------------------------- Fri Jan 15 14:29:20 CET 2010 - werner@suse.de diff --git a/ncurses.spec b/ncurses.spec index 6984e41..b44c5f0 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -49,7 +49,6 @@ Patch3: ncurses-5.7-overwrite.dif Patch4: ncurses-5.7-tack.dif Patch5: ncurses-5.7-gpm.dif Patch6: ncurses-5.6-fallback.dif -Patch7: ncurses-5.7-pthread.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -272,7 +271,6 @@ mv tack-* tack %patch -P 4 -p0 -b .hs %patch -P 5 -p0 -b .gpm %patch -P 6 -p0 -b .fb -%patch -P 7 -p0 %patch -P 0 -p0 %build From 9255ef44c6ee349f74dbbb42afaae5a4fa4fe45708ef6387540aedfad21f3f11 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 25 May 2010 08:26:16 +0000 Subject: [PATCH 5/5] Updating link to change in openSUSE:Factory/ncurses revision 29.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/ncurses?expand=0&rev=b0ab7c5f97afca189ff918c9a50de151 --- ncurses-5.7-pthread.dif | 160 ++++++++++++++++++++++++++++++++++++++++ ncurses.changes | 6 ++ ncurses.spec | 4 +- 3 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 ncurses-5.7-pthread.dif diff --git a/ncurses-5.7-pthread.dif b/ncurses-5.7-pthread.dif new file mode 100644 index 0000000..e15366e --- /dev/null +++ b/ncurses-5.7-pthread.dif @@ -0,0 +1,160 @@ +--- ncurses/base/lib_getch.c ++++ ncurses/base/lib_getch.c 2010-05-07 19:02:11.222924328 +0200 +@@ -264,7 +264,14 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_e + ch = buf; + #else + unsigned char c2 = 0; ++# ifdef USE_EINTR ++ if ((pthread_self) && (pthread_kill) && (pthread_equal)) ++ _nc_globals.read_thread = pthread_self(); ++# endif + n = read(sp->_ifd, &c2, 1); ++#ifdef USE_EINTR ++ _nc_globals.read_thread = 0; ++#endif + ch = c2; + #endif + } +@@ -279,7 +286,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_e + * 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 ++# ifdef USE_EINTR ++ && (_nc_globals.have_sigwinch == 0) ++# endif ++ ) + goto again; + #endif + +--- ncurses/base/lib_mouse.c ++++ ncurses/base/lib_mouse.c 2010-05-07 19:01:35.658924370 +0200 +@@ -838,6 +838,10 @@ _nc_mouse_inline(SCREEN *sp) + * Wheel mice may return buttons 4 and 5 when the wheel is turned. + * We encode those as button presses. + */ ++# ifdef USE_EINTR ++ if ((pthread_self) && (pthread_kill) && (pthread_equal)) ++ _nc_globals.read_thread = pthread_self(); ++# endif + for (grabbed = 0; grabbed < 3; grabbed += (size_t) res) { + + /* For VIO mouse we add extra bit 64 to disambiguate button-up. */ +@@ -849,6 +853,9 @@ _nc_mouse_inline(SCREEN *sp) + if (res == -1) + break; + } ++#ifdef USE_EINTR ++ _nc_globals.read_thread = 0; ++#endif + kbuf[3] = '\0'; + + TR(TRACE_IEVENT, +--- ncurses/curses.priv.h ++++ ncurses/curses.priv.h 2010-05-07 18:51:15.686924218 +0200 +@@ -448,8 +448,10 @@ extern NCURSES_EXPORT(int) _nc_mutex_unl + #endif + + #ifdef USE_PTHREADS ++# define USE_EINTR + # if USE_WEAK_SYMBOLS + weak_symbol(pthread_sigmask); ++weak_symbol(pthread_kill); + weak_symbol(pthread_self); + weak_symbol(pthread_equal); + weak_symbol(pthread_mutex_init); +@@ -471,6 +473,38 @@ extern NCURSES_EXPORT(int) _nc_sigprocma + + #else /* !USE_PTHREADS */ + ++#if defined(linux) && USE_SIGWINCH ++# define USE_EINTR ++#endif ++ ++#ifdef USE_EINTR ++#if defined(__GNUC__) ++# if defined __USE_ISOC99 ++# define _cat_pragma(exp) _Pragma(#exp) ++# define _weak_pragma(exp) _cat_pragma(weak name) ++# else ++# define _weak_pragma(exp) ++# endif ++# define _declare(name) __extension__ extern __typeof__(name) name ++# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) ++#endif ++ ++#include ++weak_symbol(pthread_sigmask); ++weak_symbol(pthread_kill); ++weak_symbol(pthread_self); ++weak_symbol(pthread_equal); ++static inline int _nc_sigprocmask(int how, const sigset_t *newmask, sigset_t *oldmask) ++{ ++ if ((pthread_sigmask)) ++ return pthread_sigmask(how, newmask, oldmask); ++ else ++ return sigprocmask(how, newmask, oldmask); ++} ++# undef sigprocmask ++# define sigprocmask _nc_sigprocmask ++#endif /* USE_EINTR */ ++ + #define _nc_init_pthreads() /* nothing */ + #define _nc_mutex_init(obj) /* nothing */ + +@@ -798,6 +832,9 @@ typedef struct { + int use_pthreads; + #define _nc_use_pthreads _nc_globals.use_pthreads + #endif ++#ifdef USE_EINTR ++ pthread_t read_thread; /* The reading thread */ ++#endif + } NCURSES_GLOBALS; + + extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; +--- ncurses/tinfo/lib_data.c ++++ ncurses/tinfo/lib_data.c 2010-05-07 18:46:59.706924518 +0200 +@@ -193,6 +193,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_ + 0, /* nested_tracef */ + 0, /* use_pthreads */ + #endif ++#ifdef USE_EINTR ++ 0, /* read_thread */ ++#endif + }; + + #define STACK_FRAME_0 { { 0 }, 0 } +--- ncurses/tinfo/tinfo_driver.c 2009-10-31 21:32:01.000000000 +0100 ++++ ncurses/tinfo/tinfo_driver.c 2010-05-07 19:01:44.686924794 +0200 +@@ -1248,7 +1248,14 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, i + assert(buf); + SetSP(); + ++# ifdef USE_EINTR ++ if ((pthread_self) && (pthread_kill) && (pthread_equal)) ++ _nc_globals.read_thread = pthread_self(); ++# endif + n = read(sp->_ifd, &c2, 1); ++#ifdef USE_EINTR ++ _nc_globals.read_thread = 0; ++#endif + *buf = (int) c2; + return n; + } +--- ncurses/tty/lib_tstp.c ++++ ncurses/tty/lib_tstp.c 2010-05-07 18:55:04.326924859 +0200 +@@ -286,6 +286,13 @@ static void + sigwinch(int sig GCC_UNUSED) + { + _nc_globals.have_sigwinch = 1; ++# ifdef USE_EINTR ++ if (_nc_globals.read_thread) { ++ if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) ++ pthread_kill(_nc_globals.read_thread, SIGWINCH); ++ _nc_globals.read_thread = 0; ++ } ++# endif + } + #endif /* USE_SIGWINCH */ + diff --git a/ncurses.changes b/ncurses.changes index 00341a8..5a153f7 100644 --- a/ncurses.changes +++ b/ncurses.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 7 19:09:22 CEST 2010 - werner@suse.de + +- Ad workaround to enforce that the terminal rading thread will + interrupted by SIGWINCH (bnc#540571) + ------------------------------------------------------------------- Fri Jan 15 14:29:20 CET 2010 - werner@suse.de diff --git a/ncurses.spec b/ncurses.spec index b44c5f0..29f21e8 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -32,7 +32,7 @@ Obsoletes: ncurses-64bit %endif # Version: 5.7 -Release: 2 +Release: 3 Summary: New curses Libraries Url: http://invisible-island.net/ncurses/ncurses.html Source0: ncurses-%{version}.tar.bz2 @@ -49,6 +49,7 @@ Patch3: ncurses-5.7-overwrite.dif Patch4: ncurses-5.7-tack.dif Patch5: ncurses-5.7-gpm.dif Patch6: ncurses-5.6-fallback.dif +Patch7: ncurses-5.7-pthread.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -271,6 +272,7 @@ mv tack-* tack %patch -P 4 -p0 -b .hs %patch -P 5 -p0 -b .gpm %patch -P 6 -p0 -b .fb +%patch -P 7 -p0 %patch -P 0 -p0 %build