preload-hacks: Some patches to make it work.
[termux-packages] / packages / libevent / evdns.c.patch
index 93f7bac..a2c95d9 100644 (file)
@@ -1,19 +1,28 @@
-diff -u -r ../libevent-2.0.22-stable/evdns.c ./evdns.c
---- ../libevent-2.0.22-stable/evdns.c  2014-03-26 11:09:18.000000000 -0400
-+++ ./evdns.c  2016-08-26 17:17:43.939853284 -0400
-@@ -49,6 +49,9 @@
-  */
+diff -uNr libevent-release-2.1.8-stable/evdns.c libevent-release-2.1.8-stable.mod/evdns.c
+--- libevent-release-2.1.8-stable/evdns.c      2017-01-26 01:37:15.000000000 +0200
++++ libevent-release-2.1.8-stable.mod/evdns.c  2017-09-12 12:58:45.352988051 +0300
+@@ -52,6 +52,9 @@
+ #include "evconfig-private.h"
  
  #include <sys/types.h>
 +#ifdef __ANDROID__
 +# include <sys/system_properties.h>
 +#endif
- #include "event2/event-config.h"
  
  #ifndef _FORTIFY_SOURCE
-@@ -3892,6 +3895,21 @@
+ #define _FORTIFY_SOURCE 3
+@@ -3602,7 +3605,7 @@
+       evutil_snprintf(path_out, len_out, "%s%s", path, hostfile);
+       return path_out;
+ #else
+-      return mm_strdup("/etc/hosts");
++      return mm_strdup("@TERMUX_PREFIX@/etc/hosts");
+ #endif
+ }
+@@ -3959,6 +3962,21 @@
                int r;
- #ifdef WIN32
+ #ifdef _WIN32
                r = evdns_base_config_windows_nameservers(base);
 +#elif defined(__ANDROID__)
 +              /** From: http://www.programering.com/a/MjMwcjMwATA.html */