Freebsd fixes (#555)

* freebsd fixes

* Update SocketImpl.cpp
This commit is contained in:
proller 2017-03-04 04:58:45 +03:00 committed by alexey-milovidov
parent d3b22774c9
commit e96092c66c
6 changed files with 9 additions and 6 deletions

View File

@ -144,7 +144,7 @@ if (UNIX AND NOT ANDROID )
set(SYSLIBS ${CMAKE_DL_LIBS}) set(SYSLIBS ${CMAKE_DL_LIBS})
elseif (CMAKE_SYSTEM MATCHES "FreeBSD") elseif (CMAKE_SYSTEM MATCHES "FreeBSD")
add_definitions(-D__BSD_VISIBLE ) # better #include <sys/cdefs.h> add_definitions(-D__BSD_VISIBLE ) # better #include <sys/cdefs.h>
add_definitions(-D_XOPEN_SOURCE=700 -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPOCO_HAVE_IPv6) add_definitions(-D_XOPEN_SOURCE=700 -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPOCO_HAVE_IPv6 -DPOCO_HAVE_FD_POLL)
set(SYSLIBS pthread ${CMAKE_DL_LIBS} rt) set(SYSLIBS pthread ${CMAKE_DL_LIBS} rt)
else () else ()
add_definitions(-D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPOCO_HAVE_FD_EPOLL -DPOCO_HAVE_IPv6) add_definitions(-D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPOCO_HAVE_FD_EPOLL -DPOCO_HAVE_IPv6)

View File

@ -456,7 +456,8 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
while (rc < 0 && lastError() == POCO_EINTR); while (rc < 0 && lastError() == POCO_EINTR);
::close(epollfd); ::close(epollfd);
if (rc < 0) error(); if (rc < 0)
error();
return rc > 0; return rc > 0;
#elif defined(POCO_HAVE_FD_POLL) #elif defined(POCO_HAVE_FD_POLL)
@ -486,6 +487,8 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
} }
} }
while (rc < 0 && lastError() == POCO_EINTR); while (rc < 0 && lastError() == POCO_EINTR);
if (rc < 0) error();
return rc > 0;
#else #else

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
QUERY_FIELND_NUM=4 QUERY_FIELND_NUM=4

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
clickhouse-client -q "SHOW PROCESSLIST" &>/dev/null clickhouse-client -q "SHOW PROCESSLIST" &>/dev/null
clickhouse-client -q "SHOW DATABASES" &>/dev/null clickhouse-client -q "SHOW DATABASES" &>/dev/null

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
for i in `seq -w 0 2 20`; do for i in `seq -w 0 2 20`; do

View File

@ -20,7 +20,7 @@ mkdir -p ClickHouse/build
cd ClickHouse/build cd ClickHouse/build
cmake .. -DUSE_INTERNAL_GPERFTOOLS_LIBRARY=0 cmake .. -DUSE_INTERNAL_GPERFTOOLS_LIBRARY=0
# WIP: variant with libs from ports: # WIP: variant with libs from ports:
# sudo pkg install boost-libs libzookeeper libdouble-conversion zstd liblz4 sparsehash # sudo pkg install devel/boost-libs devel/libzookeeper devel/libdouble-conversion archivers/zstd archivers/liblz4 devel/sparsehash devel/re2
# Check UNIXODBC option: # Check UNIXODBC option:
# make -C /usr/ports/devel/poco config reinstall # make -C /usr/ports/devel/poco config reinstall
# cmake .. -DUNBUNDLED=1 -DUSE_STATIC_LIBRARIES=0 -DNO_WERROR=1 # cmake .. -DUNBUNDLED=1 -DUSE_STATIC_LIBRARIES=0 -DNO_WERROR=1