Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes to make it compile properly on ARM/GCC 4.2; poller uses a two s…

…tep CLOEXEC, as it does not exist on older linux versions.

Also fixed some compilation issues when otemplate not included.
  • Loading branch information...
commit 751cdb3f79f0214665b933fda751240470244f08 1 parent d84473d
@davidmoreno authored
View
2  examples/CMakeLists.txt
@@ -30,7 +30,7 @@ if (OTEMPLATE)
message(WARNING "Some examples are disabled as you dont have libpng: mandelbrot")
endif (${PNG_ENABLED})
else(OTEMPLATE)
- message(WARNING "Some examples are disabled as you dont have otemplate installed: fileserver_otemplate mandelbrot")
+ message(WARNING "Some examples are disabled as you dont have otemplate installed: ofileserver mandelbrot")
endif(OTEMPLATE)
if (${CAIRO_ENABLED})
View
11 src/onion/poller.c
@@ -27,12 +27,16 @@
#ifdef __DEBUG__
#include <execinfo.h>
#endif
+#include <unistd.h>
+#include <fcntl.h>
+
#include "log.h"
#include "types.h"
#include "poller.h"
#include <sys/socket.h>
#include <sys/eventfd.h>
+#include <fcntl.h>
#ifdef HAVE_PTHREADS
# define __USE_UNIX98
@@ -140,6 +144,10 @@ static int onion_poller_empty_helper(void *_){
return 0;
}
+#ifndef EFD_CLOEXEC
+#define EFD_CLOEXEC 0
+#endif
+
/**
* @short Returns a poller object that helps polling on sockets and files
* @memberof onion_poller_t
@@ -157,6 +165,9 @@ onion_poller *onion_poller_new(int n){
return NULL;
}
p->eventfd=eventfd(0,EFD_CLOEXEC);
+#if EFD_CLOEXEC == 0
+ fcntl(p->eventfd,F_SETFD,FD_CLOEXEC);
+#endif
p->head=NULL;
p->n=0;
p->stop=0;
View
2  tests/01-internal/CMakeLists.txt
@@ -38,6 +38,7 @@ add_executable(12-cloexec 12-cloexec.c)
target_link_libraries(12-cloexec onion curl)
ENDIF (CURL)
+if (OTEMPLATE)
add_executable(13-otemplates 13-otemplates.c 13-otemplate_html.c)
add_custom_command(
OUTPUT 13-otemplate_html.c
@@ -46,3 +47,4 @@ add_custom_command(
DEPENDS ${OTEMPLATE} ${CMAKE_CURRENT_SOURCE_DIR}/13-otemplate.html
)
target_link_libraries(13-otemplates onion)
+endif (OTEMPLATE)
Please sign in to comment.
Something went wrong with that request. Please try again.