| OLD | NEW |
| 1 diff --git a/src/Makefile.in b/src/Makefile.in | 1 diff --git a/src/Makefile.in b/src/Makefile.in |
| 2 --- a/src/Makefile.in | 2 --- a/src/Makefile.in |
| 3 +++ b/src/Makefile.in | 3 +++ b/src/Makefile.in |
| 4 @@ -161,6 +161,7 @@ netcat_SOURCES = \ | 4 @@ -161,6 +161,7 @@ netcat_SOURCES = \ |
| 5 | 5 |
| 6 | 6 |
| 7 netcat_LDADD = @CONTRIBLIBS@ @INTLLIBS@ | 7 netcat_LDADD = @CONTRIBLIBS@ @INTLLIBS@ |
| 8 +netcat_PPAPI = -lppapi_simple -lnacl_io -lppapi | 8 +netcat_PPAPI = -lppapi_simple -lnacl_io -lppapi |
| 9 | 9 |
| 10 EXTRA_DIST = *.h | 10 EXTRA_DIST = *.h |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 - rand = 1; /* simulates a random number */ | 52 - rand = 1; /* simulates a random number */ |
| 53 + randv = 1; /* simulates a random number */ | 53 + randv = 1; /* simulates a random number */ |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 /* loop until we find the specified flag */ | 56 /* loop until we find the specified flag */ |
| 57 - while (rand--) | 57 - while (rand--) |
| 58 + while (randv--) | 58 + while (randv--) |
| 59 ret = netcat_flag_next(ret); | 59 ret = netcat_flag_next(ret); |
| 60 | 60 |
| 61 /* don't return this same flag again */ | 61 /* don't return this same flag again */ |
| 62 diff --git a/src/netcat.c b/src/netcat.c | |
| 63 --- a/src/netcat.c | |
| 64 +++ b/src/netcat.c | |
| 65 @@ -135,7 +135,11 @@ static void ncexec(nc_sock_t *ncsock) | |
| 66 | |
| 67 /* main: handle command line arguments and listening status */ | |
| 68 | |
| 69 +#if defined(__native_client__) | |
| 70 +int nacl_ppapi_main(int argc, char *argv[]) | |
| 71 +#else | |
| 72 int main(int argc, char *argv[]) | |
| 73 +#endif | |
| 74 { | |
| 75 int c, glob_ret = EXIT_FAILURE; | |
| 76 int total_ports, left_ports, accept_ret = -1, connect_ret = -1; | |
| 77 @@ -616,3 +620,8 @@ int main(int argc, char *argv[]) | |
| 78 netcat_printstats(FALSE); | |
| 79 return glob_ret; | |
| 80 } /* end of main() */ | |
| 81 + | |
| 82 +#if defined(__native_client__) | |
| 83 +#include "ppapi_simple/ps_main.h" | |
| 84 +PPAPI_SIMPLE_REGISTER_MAIN(nacl_ppapi_main) | |
| 85 +#endif | |
| 86 diff --git a/src/udphelper.c b/src/udphelper.c | 62 diff --git a/src/udphelper.c b/src/udphelper.c |
| 87 --- a/src/udphelper.c | 63 --- a/src/udphelper.c |
| 88 +++ b/src/udphelper.c | 64 +++ b/src/udphelper.c |
| 89 @@ -30,7 +30,9 @@ | 65 @@ -30,7 +30,9 @@ |
| 90 | 66 |
| 91 #ifndef USE_PKTINFO | 67 #ifndef USE_PKTINFO |
| 92 #include <sys/ioctl.h> | 68 #include <sys/ioctl.h> |
| 93 -#include <net/if.h> | 69 -#include <net/if.h> |
| 94 +#if !defined(__native_client__) || defined(__GLIBC__) | 70 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 95 +# include <net/if.h> | 71 +# include <net/if.h> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 112 int *my_sockbuf = NULL, my_sockbuf_max = 0, sock_total = 0; | 88 int *my_sockbuf = NULL, my_sockbuf_max = 0, sock_total = 0; |
| 113 unsigned int if_pos = 0; | 89 unsigned int if_pos = 0; |
| 114 @@ -279,6 +288,7 @@ int udphelper_sockets_open(int **sockbuf, in_port_t nport) | 90 @@ -279,6 +288,7 @@ int udphelper_sockets_open(int **sockbuf, in_port_t nport) |
| 115 errno = ret; | 91 errno = ret; |
| 116 | 92 |
| 117 return -1; | 93 return -1; |
| 118 +#endif | 94 +#endif |
| 119 } | 95 } |
| 120 | 96 |
| 121 #endif /* USE_PKTINFO */ | 97 #endif /* USE_PKTINFO */ |
| OLD | NEW |