From 025726dcab9b267ef55c07510e2c3d6c9eea5009 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 7 Apr 2014 15:24:23 +0930 Subject: [PATCH] Fix android build, related to issue #76 fix --- Android.mk | 1 + monitor.c | 13 +------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Android.mk b/Android.mk index 43971d68..402d4fb1 100644 --- a/Android.mk +++ b/Android.mk @@ -28,6 +28,7 @@ SERVALD_LOCAL_CFLAGS = \ -DHAVE_JNI_H=1 -DHAVE_STRUCT_UCRED=1 -DHAVE_CRYPTO_SIGN_NACL_GE25519_H=1 \ -DBYTE_ORDER=_BYTE_ORDER -DHAVE_LINUX_STRUCT_UCRED -DUSE_ABSTRACT_NAMESPACE \ -DHAVE_BCOPY -DHAVE_BZERO -DHAVE_NETINET_IN_H -DHAVE_LSEEK64 -DSIZEOF_OFF_T=4 \ + -DHAVE_LINUX_IF_H \ -I$(NACL_INC) \ -I$(SQLITE3_INC) diff --git a/monitor.c b/monitor.c index f26bfe9a..fab9f9f3 100644 --- a/monitor.c +++ b/monitor.c @@ -155,22 +155,11 @@ void monitor_poll(struct sched_ent *alarm) /* Check for new connections */ /* We don't care about the peer's address */ ignored_length = 0; - while ( -#ifdef HAVE_LINUX_IF_H - (s = accept4(alarm->poll.fd, NULL, &ignored_length,O_NONBLOCK)) -#else - (s = accept(alarm->poll.fd,NULL, &ignored_length)) -#endif - != -1 - ) { + while ((s = accept(alarm->poll.fd,NULL, &ignored_length))!= -1) { monitor_new_client(s); } if (errno != EAGAIN) { -#ifdef HAVE_LINUX_IF_H - WHY_perror("accept4(O_NONBLOCK)"); -#else WHY_perror("accept"); -#endif } }