summaryrefslogtreecommitdiff
path: root/data/netcat/mdns.diff
blob: 89cc0e2ed4ecabcea1964c2ff4c1dfedd12060c5 (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
diff -ru netcat-0.7.1/src/netcat.c netcat-0.7.1+iPhone/src/netcat.c
--- netcat-0.7.1/src/netcat.c	2003-08-28 17:20:25.000000000 +0000
+++ netcat-0.7.1+iPhone/src/netcat.c	2008-04-10 10:02:32.000000000 +0000
@@ -1,3 +1,5 @@
+#include <mach-o/nlist.h>
+
 /*
  * netcat.c -- main project file
  * Part of the GNU netcat project
@@ -137,6 +139,15 @@
 
 int main(int argc, char *argv[])
 {
+#if !defined(__ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200
+    struct nlist nl[2];
+    memset(nl, 0, sizeof(nl));
+    nl[0].n_un.n_name = (char *) "_useMDNSResponder";
+    nlist("/usr/lib/libc.dylib", nl);
+    if (nl[0].n_type != N_UNDF)
+        *(int *) nl[0].n_value = 0;
+#endif
+
   int c, glob_ret = EXIT_FAILURE;
   int total_ports, left_ports, accept_ret = -1, connect_ret = -1;
   struct sigaction sv;