replace select to poll (#584)
* replace select * Added poll/select selection during compilation --------- Co-authored-by: Olof Hagsand <olof@hagsand.se>
This commit is contained in:
parent
4080bd3a5a
commit
2a6bbac712
3 changed files with 32 additions and 1 deletions
|
|
@ -465,6 +465,13 @@ AH_BOTTOM([#include <clixon_custom.h>])
|
||||||
|
|
||||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([event-poll],
|
||||||
|
AS_HELP_STRING([--enable-event-poll], [Enable event polling feature]),
|
||||||
|
[if test "$enable_event_poll" = "yes"; then
|
||||||
|
AC_DEFINE([CLIXON_EVENT_POLL], 1, [Enable event polling feature])
|
||||||
|
fi]
|
||||||
|
)
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
lib/Makefile
|
lib/Makefile
|
||||||
lib/src/Makefile
|
lib/src/Makefile
|
||||||
|
|
|
||||||
|
|
@ -213,8 +213,8 @@
|
||||||
* This causes xml_cmp to show that the datastores are unequal and may cause a wrong diff, or
|
* This causes xml_cmp to show that the datastores are unequal and may cause a wrong diff, or
|
||||||
* worse case an overwrite.
|
* worse case an overwrite.
|
||||||
*/
|
*/
|
||||||
#undef SYSTEM_ONLY_CONFIG_CANDIDATE_CLEAR
|
|
||||||
|
|
||||||
|
#undef SYSTEM_ONLY_CONFIG_CANDIDATE_CLEAR
|
||||||
/*! In full XPath namespace resolve, match even if namespace not resolved
|
/*! In full XPath namespace resolve, match even if namespace not resolved
|
||||||
*
|
*
|
||||||
* In the case of xpath lookup functions (eg xpath_vec_ctx) where nsc is defined, then
|
* In the case of xpath lookup functions (eg xpath_vec_ctx) where nsc is defined, then
|
||||||
|
|
@ -224,3 +224,4 @@
|
||||||
* This seems wrong and should be changed, but need further investigation
|
* This seems wrong and should be changed, but need further investigation
|
||||||
*/
|
*/
|
||||||
#define XPATH_NS_ACCEPT_UNRESOLVED
|
#define XPATH_NS_ACCEPT_UNRESOLVED
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,10 @@
|
||||||
#include "clixon_options.h"
|
#include "clixon_options.h"
|
||||||
#include "clixon_event.h"
|
#include "clixon_event.h"
|
||||||
|
|
||||||
|
#ifdef CLIXON_EVENT_POLL
|
||||||
|
#include <poll.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
|
|
@ -353,6 +357,24 @@ clixon_event_unreg_timeout(int (*fn)(int, void*),
|
||||||
* @retval 0 Nothing to read/empty fd
|
* @retval 0 Nothing to read/empty fd
|
||||||
* @retval -1 Error
|
* @retval -1 Error
|
||||||
*/
|
*/
|
||||||
|
#ifdef CLIXON_EVENT_POLL
|
||||||
|
int
|
||||||
|
clixon_event_poll(int fd) {
|
||||||
|
struct pollfd pfd;
|
||||||
|
int retval;
|
||||||
|
|
||||||
|
pfd.fd = fd;
|
||||||
|
pfd.events = POLLIN;
|
||||||
|
|
||||||
|
retval = poll(&pfd, 1, 0);
|
||||||
|
|
||||||
|
if (retval < 0) {
|
||||||
|
clixon_err(OE_EVENTS, errno, "poll");
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
#else
|
||||||
int
|
int
|
||||||
clixon_event_poll(int fd)
|
clixon_event_poll(int fd)
|
||||||
{
|
{
|
||||||
|
|
@ -366,6 +388,7 @@ clixon_event_poll(int fd)
|
||||||
clixon_err(OE_EVENTS, errno, "select");
|
clixon_err(OE_EVENTS, errno, "select");
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*! Dispatch file descriptor events (and timeouts) by invoking callbacks.
|
/*! Dispatch file descriptor events (and timeouts) by invoking callbacks.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue