mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-20 04:02:27 +00:00
Fix build on recent 7.X.
Reported by: pointyhat via kris
This commit is contained in:
parent
466eb19304
commit
576a71e9b3
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=164189
32
net/mrt/files/patch-lib::mrt::prefix.c
Normal file
32
net/mrt/files/patch-lib::mrt::prefix.c
Normal file
@ -0,0 +1,32 @@
|
||||
Index: lib/mrt/prefix.c
|
||||
diff -u -p lib/mrt/prefix.c.orig lib/mrt/prefix.c
|
||||
--- lib/mrt/prefix.c.orig Sat Apr 29 04:31:05 2000
|
||||
+++ lib/mrt/prefix.c Fri Jun 2 11:23:40 2006
|
||||
@@ -16,7 +16,8 @@
|
||||
#endif /* NT */
|
||||
|
||||
|
||||
-#ifndef __GLIBC__
|
||||
+#if !defined(__GLIBC__) && \
|
||||
+ (!defined(__FreeBSD__) || !defined(HAVE_GETHOSTBYNAME_R))
|
||||
#ifdef __osf__
|
||||
|
||||
/* apparently, OSF's gethostby{name,addr}_r's are different, broken, and
|
||||
@@ -51,7 +52,7 @@ struct hostent *gethostbyaddr_r
|
||||
For the time being, this part tries to convert Linux glibc 2.X
|
||||
gethostXX_r into Solaris's that we use to code MRT. -- masaki
|
||||
*/
|
||||
-#if __GLIBC__ >= 2
|
||||
+#if __GLIBC__ >= 2 || (defined(__FreeBSD__) && defined(HAVE_GETHOSTBYNAME_R))
|
||||
/* Glibc 2.X
|
||||
|
||||
int gethostbyname_r (const char *name, struct hostent *result_buf,
|
||||
@@ -311,7 +312,7 @@ prefix_toname (prefix_t *prefix)
|
||||
|
||||
if (prefix == NULL) return (strdup ("invalid name"));
|
||||
|
||||
-#ifdef GETHOSTBYADDR_R
|
||||
+#ifdef HAVE_GETHOSTBYADDR_R
|
||||
hostinfo = gethostbyaddr_r((char *) prefix_tochar(prefix),
|
||||
(prefix->bitlen)/8, prefix->family, &result,
|
||||
hostbuf, sizeof hostbuf, &h_errno_r);
|
Loading…
Reference in New Issue
Block a user