Files
main/x11/library/libX11/files/fix-segfault.diff
T
2015-06-20 09:28:59 +03:00

51 lines
1.4 KiB
Diff

Index: libX11-1.4.99.1/src/Xrm.c
===================================================================
--- libX11-1.4.99.1.orig/src/Xrm.c
+++ libX11-1.4.99.1/src/Xrm.c
@@ -2540,30 +2540,40 @@ Bool XrmQGetResource(
VClosureRec closure;
if (db && *names) {
- _XLockMutex(&db->linfo);
+ if ((_XLockMutex_fn) && db->linfo.lock ) {
+ _XLockMutex(&db->linfo);
+ }
closure.type = pType;
closure.value = pValue;
table = db->table;
if (names[1]) {
if (table && !table->leaf) {
if (GetNEntry(table, names, classes, &closure)) {
- _XUnlockMutex(&db->linfo);
+ if ((_XUnlockMutex_fn) && db->linfo.lock ) {
+ _XUnlockMutex(&db->linfo);
+ }
return True;
}
} else if (table && table->hasloose &&
GetLooseVEntry((LTable)table, names, classes, &closure)) {
- _XUnlockMutex (&db->linfo);
+ if ((_XUnlockMutex_fn) && db->linfo.lock ) {
+ _XUnlockMutex (&db->linfo);
+ }
return True;
}
} else {
if (table && !table->leaf)
table = table->next;
if (table && GetVEntry((LTable)table, names, classes, &closure)) {
- _XUnlockMutex(&db->linfo);
+ if ((_XUnlockMutex_fn) && db->linfo.lock ) {
+ _XUnlockMutex(&db->linfo);
+ }
return True;
}
}
- _XUnlockMutex(&db->linfo);
+ if ((_XUnlockMutex_fn) && db->linfo.lock ) {
+ _XUnlockMutex(&db->linfo);
+ }
}
*pType = NULLQUARK;
pValue->addr = (XPointer)NULL;