4ad6b64c40
readdir and getpwuid handling for DragonFly, avoids the mouse problems due to use of floating point math in a signal handler (xorg-server).
30 lines
1.2 KiB
Text
30 lines
1.2 KiB
Text
$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) \
|