Skip to content

Commit

Permalink
Fix the build on OpenBSD (#488)
Browse files Browse the repository at this point in the history
* cast pthread_t for printf
* don't use RTLD_NOLOAD
* tokudb fails without F_NOCACHE and O_DIRECT - ditto
  • Loading branch information
devnexen authored and vuvova committed Nov 17, 2017
1 parent 4666f01 commit 685db2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sql/wsrep_mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ static bool abort_replicated(THD *thd)
bool ret_code= false;
if (thd->wsrep_query_state== QUERY_COMMITTING)
{
WSREP_DEBUG("aborting replicated trx: %lu", thd->real_id);
WSREP_DEBUG("aborting replicated trx: %llu", (ulonglong)(thd->real_id));

(void)wsrep_abort_thd(thd, thd, TRUE);
ret_code= true;
Expand Down
14 changes: 6 additions & 8 deletions storage/connect/reldef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,12 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
} // endif dladdr
#endif // 0

// Is the library already loaded?
if (!Hdll && !(Hdll = dlopen(soname, RTLD_NOLOAD)))
// Load the desired shared library
if (!(Hdll = dlopen(soname, RTLD_LAZY))) {
error = dlerror();
sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
return NULL;
} // endif Hdll
// Load the desired shared library
if (!Hdll && !(Hdll = dlopen(soname, RTLD_LAZY))) {
error = dlerror();
sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
return NULL;
} // endif Hdll

// The exported name is always in uppercase
for (int i = 0; ; i++) {
Expand Down
4 changes: 3 additions & 1 deletion storage/tokudb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ IF(CMAKE_VERSION VERSION_LESS "2.8.9")
MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
# tokudb requires F_NOCACHE, O_DIRECT, and designated initializers
CHECK_CXX_SOURCE_COMPILES(
"
#include <fcntl.h>
struct a {int b; int c; };
struct a d = { .b=1, .c=2 };
int main() { return 0; }
int main() { return F_NOCACHE + O_DIRECT; }
" TOKUDB_OK)
ENDIF()

Expand Down

0 comments on commit 685db2c

Please sign in to comment.