Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: ports/libevent/nacl.patch

Issue 1311703003: Added Tor Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/libevent/build.sh ('k') | ports/libevent/pkg_info » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/evutil.c b/evutil.c
2 --- a/evutil.c
3 +++ b/evutil.c
4 @@ -183,9 +183,15 @@ int
5 evutil_socketpair(int family, int type, int protocol, evutil_socket_t fd[2])
6 {
7 #ifndef WIN32
8 - return socketpair(family, type, protocol, fd);
9 + #ifdef __native_client__
10 + // nacl.io lacks socketpair implementation.
11 + // TODO(dt) remove this once socketpair is available on nacl.io
12 + return evutil_ersatz_socketpair(family, type, protocol, fd);
13 + #else
14 + return socketpair(family, type, protocol, fd);
15 + #endif
16 #else
17 - return evutil_ersatz_socketpair(family, type, protocol, fd);
18 + return evutil_ersatz_socketpair(family, type, protocol, fd);
19 #endif
20 }
21
22 @@ -2187,4 +2193,3 @@ evutil_load_windows_system_library(const TCHAR *library_na me)
23 return LoadLibrary(path);
24 }
25 #endif
26 -
27 diff --git a/sample/hello-world.c b/sample/hello-world.c
28 --- a/sample/hello-world.c
29 +++ b/sample/hello-world.c
30 @@ -66,14 +66,19 @@ main(int argc, char **argv)
31 if (!listener) {
32 fprintf(stderr, "Could not create a listener!\n");
33 return 1;
34 - }
35 + } else {
36 + printf("\n listening on port %d\n",PORT);
37 + }
38
39 +// nacl_io don't support signals
40 +#ifndef __native_client__
41 signal_event = evsignal_new(base, SIGINT, signal_cb, (void *)base);
42
43 if (!signal_event || event_add(signal_event, NULL)<0) {
44 fprintf(stderr, "Could not create/add a signal event!\n");
45 return 1;
46 }
47 +#endif
48
49 event_base_dispatch(base);
50
51 @@ -129,6 +134,8 @@ conn_eventcb(struct bufferevent *bev, short events, void *us er_data)
52 bufferevent_free(bev);
53 }
54
55 +// nacl_io don't support signals
56 +#ifndef __native_client__
57 static void
58 signal_cb(evutil_socket_t sig, short events, void *user_data)
59 {
60 @@ -139,3 +146,4 @@ signal_cb(evutil_socket_t sig, short events, void *user_data )
61
62 event_base_loopexit(base, &delay);
63 }
64 +#endif
OLDNEW
« no previous file with comments | « ports/libevent/build.sh ('k') | ports/libevent/pkg_info » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698