From e96092c66c6d8a9ae9e843155b638fd63fd1e2fa Mon Sep 17 00:00:00 2001 From: proller Date: Sat, 4 Mar 2017 04:58:45 +0300 Subject: [PATCH] Freebsd fixes (#555) * freebsd fixes * Update SocketImpl.cpp --- contrib/libpoco/CMakeLists.txt | 2 +- contrib/libpoco/Net/src/SocketImpl.cpp | 5 ++++- dbms/tests/queries/0_stateless/00417_kill_query.sh | 2 +- dbms/tests/queries/0_stateless/00419_show_sql_queries.sh | 2 +- .../queries/0_stateless/00421_storage_merge__table_index.sh | 2 +- doc/build_freebsd.sh | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/contrib/libpoco/CMakeLists.txt b/contrib/libpoco/CMakeLists.txt index 26cef15993e..2baa9dbd82c 100644 --- a/contrib/libpoco/CMakeLists.txt +++ b/contrib/libpoco/CMakeLists.txt @@ -144,7 +144,7 @@ if (UNIX AND NOT ANDROID ) set(SYSLIBS ${CMAKE_DL_LIBS}) elseif (CMAKE_SYSTEM MATCHES "FreeBSD") add_definitions(-D__BSD_VISIBLE ) # better #include - 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) 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) diff --git a/contrib/libpoco/Net/src/SocketImpl.cpp b/contrib/libpoco/Net/src/SocketImpl.cpp index d4199716d4d..b94e47f8535 100644 --- a/contrib/libpoco/Net/src/SocketImpl.cpp +++ b/contrib/libpoco/Net/src/SocketImpl.cpp @@ -456,7 +456,8 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode) while (rc < 0 && lastError() == POCO_EINTR); ::close(epollfd); - if (rc < 0) error(); + if (rc < 0) + error(); return rc > 0; #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); + if (rc < 0) error(); + return rc > 0; #else diff --git a/dbms/tests/queries/0_stateless/00417_kill_query.sh b/dbms/tests/queries/0_stateless/00417_kill_query.sh index d1b73fa50a1..e05c193db21 100755 --- a/dbms/tests/queries/0_stateless/00417_kill_query.sh +++ b/dbms/tests/queries/0_stateless/00417_kill_query.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e QUERY_FIELND_NUM=4 diff --git a/dbms/tests/queries/0_stateless/00419_show_sql_queries.sh b/dbms/tests/queries/0_stateless/00419_show_sql_queries.sh index ba9feb54bc8..fc84e576041 100755 --- a/dbms/tests/queries/0_stateless/00419_show_sql_queries.sh +++ b/dbms/tests/queries/0_stateless/00419_show_sql_queries.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash clickhouse-client -q "SHOW PROCESSLIST" &>/dev/null clickhouse-client -q "SHOW DATABASES" &>/dev/null diff --git a/dbms/tests/queries/0_stateless/00421_storage_merge__table_index.sh b/dbms/tests/queries/0_stateless/00421_storage_merge__table_index.sh index afce4a16b67..2b9f442f480 100755 --- a/dbms/tests/queries/0_stateless/00421_storage_merge__table_index.sh +++ b/dbms/tests/queries/0_stateless/00421_storage_merge__table_index.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e for i in `seq -w 0 2 20`; do diff --git a/doc/build_freebsd.sh b/doc/build_freebsd.sh index ce1df57b882..92fd419323d 100755 --- a/doc/build_freebsd.sh +++ b/doc/build_freebsd.sh @@ -20,7 +20,7 @@ mkdir -p ClickHouse/build cd ClickHouse/build cmake .. -DUSE_INTERNAL_GPERFTOOLS_LIBRARY=0 # 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: # make -C /usr/ports/devel/poco config reinstall # cmake .. -DUNBUNDLED=1 -DUSE_STATIC_LIBRARIES=0 -DNO_WERROR=1