Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36eda7c
commit d9a76be
Showing
1 changed file
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
From 8d3782f681ba065c74e863d09c34c5f09079761f Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr> | ||
Date: Sat, 16 Jan 2016 03:19:58 +0100 | ||
Subject: [PATCH 1/3] configure: add proper check for fd_set.bits | ||
|
||
--- | ||
configure.ac | 22 ++++++++++++++++++++++ | ||
1 file changed, 22 insertions(+) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 355fd0b..a405f15 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -98,6 +98,28 @@ if test "x$fds_bits_found" = xfalse ; then | ||
fi | ||
|
||
if test "x$fds_bits_found" = xfalse ; then | ||
+AC_CHECK_MEMBER(fd_set.bits, | ||
+ [ | ||
+ fds_bits_found=plain_simple | ||
+ USE_FDS_BITS="bits" | ||
+ ],, | ||
+ [ | ||
+ #ifdef HAVE_SYS_PARAM_H | ||
+ #include <sys/param.h> | ||
+ #endif | ||
+ #ifdef HAVE_SYS_TYPES_H | ||
+ #include <sys/types.h> | ||
+ #endif | ||
+ #ifdef HAVE_SYS_TIME_H | ||
+ #include <sys/time.h> | ||
+ #endif | ||
+ #ifdef HAVE_SYS_SELECT_H | ||
+ #include <sys/select.h> | ||
+ #endif | ||
+ ]) | ||
+fi | ||
+ | ||
+if test "x$fds_bits_found" = xfalse ; then | ||
AC_MSG_ERROR([Could not determine how to access the fds_bits or equivalent | ||
structure in fd_set on your platform.]) | ||
fi | ||
-- | ||
2.7.0 | ||
|
||
|
||
From 841916ca1eddd85d810199b1d45124557bbc729d Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr> | ||
Date: Sat, 16 Jan 2016 03:20:41 +0100 | ||
Subject: [PATCH 2/3] Assume Haiku uses POSIX thread safe functions | ||
|
||
--- | ||
Xos_r.h | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/Xos_r.h b/Xos_r.h | ||
index f963b64..f8b727b 100644 | ||
--- a/Xos_r.h | ||
+++ b/Xos_r.h | ||
@@ -88,6 +88,10 @@ in this Software without prior written authorization from The Open Group. | ||
# endif | ||
#endif /* _XOS_R_H */ | ||
|
||
+#ifdef __HAIKU__ | ||
+#define _POSIX_THREAD_SAFE_FUNCTIONS | ||
+#endif | ||
+ | ||
#ifndef WIN32 | ||
|
||
#ifdef __cplusplus | ||
-- | ||
2.7.0 | ||
|
||
|
||
From 7b9129e4552dd9c4720d466b13a955214becd1be Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr> | ||
Date: Sat, 16 Jan 2016 03:15:19 +0100 | ||
Subject: [PATCH 3/3] Haiku only has POSIX-mandated passwd fields | ||
|
||
--- | ||
Xos_r.h | 29 +++++++++++++++++++++++++++++ | ||
1 file changed, 29 insertions(+) | ||
|
||
diff --git a/Xos_r.h b/Xos_r.h | ||
index f8b727b..b4a35ef 100644 | ||
--- a/Xos_r.h | ||
+++ b/Xos_r.h | ||
@@ -284,6 +284,35 @@ static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) | ||
(p).pwp = &(p).pws; | ||
} | ||
|
||
+#elif defined(__HAIKU__) | ||
+/* Haiku just has what POSIX mandates, who needs more??? */ | ||
+static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) | ||
+{ | ||
+ memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); | ||
+ | ||
+ (p).pws.pw_name = (p).pwbuf; | ||
+ (p).len = strlen((p).pwp->pw_name); | ||
+ strcpy((p).pws.pw_name, (p).pwp->pw_name); | ||
+ | ||
+ (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1; | ||
+ (p).len = strlen((p).pwp->pw_passwd); | ||
+ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd); | ||
+ | ||
+ (p).pws.pw_gecos = (p).pws.pw_passwd + (p).len + 1; | ||
+ (p).len = strlen((p).pwp->pw_gecos); | ||
+ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos); | ||
+ | ||
+ (p).pws.pw_dir = (p).pws.pw_gecos + (p).len + 1; | ||
+ (p).len = strlen((p).pwp->pw_dir); | ||
+ strcpy((p).pws.pw_dir, (p).pwp->pw_dir); | ||
+ | ||
+ (p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1; | ||
+ (p).len = strlen((p).pwp->pw_shell); | ||
+ strcpy((p).pws.pw_shell, (p).pwp->pw_shell); | ||
+ | ||
+ (p).pwp = &(p).pws; | ||
+} | ||
+ | ||
#else | ||
# define _Xpw_copyPasswd(p) \ | ||
(memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)), \ | ||
-- | ||
2.7.0 | ||
|