| Index: native_client_sdk/src/examples/demo/nacl_io_demo/nacl_io_demo.c
|
| diff --git a/native_client_sdk/src/examples/demo/nacl_io_demo/nacl_io_demo.c b/native_client_sdk/src/examples/demo/nacl_io_demo/nacl_io_demo.c
|
| index 226d50f662ea4546ea45f62b2342dca5fb4840fc..d103c1f7c4dadc2d9eb14c379406409e220867be 100644
|
| --- a/native_client_sdk/src/examples/demo/nacl_io_demo/nacl_io_demo.c
|
| +++ b/native_client_sdk/src/examples/demo/nacl_io_demo/nacl_io_demo.c
|
| @@ -41,6 +41,16 @@
|
| #define va_copy(d, s) ((d) = (s))
|
| #endif
|
|
|
| +/**
|
| + * The location of MAX is inconsitantly between LIBCs, so instead
|
| + * we define it here for consistency.
|
| + */
|
| +static int larger_int_of(int a, int b) {
|
| + if (a > b)
|
| + return a;
|
| + return b;
|
| +}
|
| +
|
| typedef struct {
|
| const char* name;
|
| HandleFunc function;
|
| @@ -312,8 +322,8 @@ static void* EchoThread(void* user_data) {
|
| int fd1 = open("/dev/jspipe1", O_RDWR | O_NONBLOCK);
|
| int fd2 = open("/dev/jspipe2", O_RDWR | O_NONBLOCK);
|
| int fd3 = open("/dev/jspipe3", O_RDWR | O_NONBLOCK);
|
| - int nfds = MAX(fd1, fd2);
|
| - nfds = MAX(nfds, fd3);
|
| + int nfds = larger_int_of(fd1, fd2);
|
| + nfds = larger_int_of(nfds, fd3);
|
| while (1) {
|
| fd_set readfds;
|
| FD_ZERO(&readfds);
|
|
|