summaryrefslogtreecommitdiff
path: root/x11/xorg-libs/patches/patch-bc
blob: 6543b685f7b46a64ad1efc5e70fc56f3e24bfbca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$NetBSD: patch-bc,v 1.5 2006/01/19 00:59:27 joerg Exp $

--- include/Xos_r.h.orig	2005-07-13 07:23:56.000000000 +0000
+++ include/Xos_r.h
@@ -208,6 +208,9 @@ extern void XtProcessUnlock(
 # undef _POSIX_THREAD_SAFE_FUNCTIONS
 #endif
 
+#if defined(__DragonFly__)
+#define XNO_MTSAFE_PWDAPI 1
+#endif
 
 /***** <pwd.h> wrappers *****/
 
@@ -655,6 +658,15 @@ extern int _Preaddir_r(DIR *, struct dir
 # elif defined(SVR4)
 /* Pre-POSIX API, returns non-NULL on success. */
 #  define _XReaddir(d,p)	(readdir_r((d), &(p).dir_entry))
+#elif defined(__DragonFly__)
+#  define _XReaddir(d,p)        \
+    ( (_Xos_processLock),                                               \
+      (((p).result = readdir((d))) ?                                    \
+       (memcpy(&((p).dir_entry), (p).result, _DIRENT_MINSIZ((p).result)),     \
+        ((p).result = &(p).dir_entry), 0) :                             \
+       0),                                                              \
+      (_Xos_processUnlock),                                             \
+      (p).result )
 # else
 /* We have no idea what is going on.  Fake it all using process locks. */
 #  define _XReaddir(d,p)	\