48 lines
1.5 KiB
Plaintext
48 lines
1.5 KiB
Plaintext
With ncurses-6.0-20170701.patch
|
|
|
|
+ improve compatibility between different configurations of new_prescr,
|
|
fixing a case with threaded code and term-driver where c++/demo did
|
|
not work (cf: 20160213).
|
|
|
|
the pthread_self(3) function call had been called without checking if the
|
|
library libpthread has been linked. This break e.g. grub (boo#1058509) if
|
|
statically linked.
|
|
|
|
---
|
|
ncurses/tinfo/lib_setup.c | 8 +++++---
|
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
--- ncurses/tinfo/lib_setup.c
|
|
+++ ncurses/tinfo/lib_setup.c 2018-03-01 10:58:23.280319133 +0000
|
|
@@ -830,8 +830,9 @@ _nc_find_prescr(void)
|
|
{
|
|
SCREEN *result = 0;
|
|
PRESCREEN_LIST *p;
|
|
+ pthread_t id = ((pthread_self)) ? pthread_self() : (pthread_t)getpid();
|
|
for (p = _nc_prescreen.allocated; p != 0; p = p->next) {
|
|
- if (p->id == pthread_self()) {
|
|
+ if (p->id == id) {
|
|
result = p->sp;
|
|
break;
|
|
}
|
|
@@ -848,8 +849,9 @@ NCURSES_EXPORT(void)
|
|
_nc_forget_prescr(void)
|
|
{
|
|
PRESCREEN_LIST *p, *q;
|
|
+ pthread_t id = ((pthread_self)) ? pthread_self() : (pthread_t)getpid();
|
|
for (p = _nc_prescreen.allocated, q = 0; p != 0; q = p, p = p->next) {
|
|
- if (p->id == pthread_self()) {
|
|
+ if (p->id == id) {
|
|
if (q) {
|
|
q->next = p->next;
|
|
} else {
|
|
@@ -885,7 +887,7 @@ new_prescr(void)
|
|
#ifdef USE_PTHREADS
|
|
PRESCREEN_LIST *p = typeCalloc(PRESCREEN_LIST, 1);
|
|
if (p != 0) {
|
|
- p->id = pthread_self();
|
|
+ p->id = ((pthread_self)) ? pthread_self() : (pthread_t)getpid();
|
|
p->sp = sp;
|
|
p->next = _nc_prescreen.allocated;
|
|
_nc_prescreen.allocated = p;
|