Skip to content

Commit

Permalink
C/C integration
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Aug 12, 2016
1 parent beea350 commit 1cefbbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
7 changes: 4 additions & 3 deletions libmariadb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ IF(FOR_SERVER)
IF(WIN32)
SET_TARGET_PROPERTIES(libmariadb PROPERTIES OUTPUT_NAME libmysql)
ELSE()
SET_TARGET_PROPERTIES(libmariadb PROPERTIES OUTPUT_NAME mysqlclient)
SET_TARGET_PROPERTIES(libmariadb PROPERTIES OUTPUT_NAME libmysqlclient)
ENDIF()
ENDIF()

Expand All @@ -389,10 +389,11 @@ SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "$

SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "")

IF(NOT FOR_SERVER)
SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION
${CPACK_PACKAGE_VERSION_MAJOR}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR})

ENDIF()
#
# Installation
#
Expand All @@ -402,7 +403,7 @@ INCLUDE(${PROJECT_SOURCE_DIR}/cmake/symlink.cmake)
# There are still several projects which don't make use
# of the config program. To make sure these programs can
# use mariadb client library we provide libmysql symlinks
IF(NOT WIN32 AND WITH_MYSQLCOMPAT)
IF(NOT WIN32 AND WITH_MYSQLCOMPAT AND NOT FOR_SERVER)
SET(INSTALL_PATH ${LIB_INSTALL_DIR}/${SUFFIX_INSTALL_DIR})
create_symlink(libmysqlclient${CMAKE_SHARED_LIBRARY_SUFFIX} libmariadb ${INSTALL_PATH})
create_symlink(libmysqlclient_r${CMAKE_SHARED_LIBRARY_SUFFIX} libmariadb ${INSTALL_PATH})
Expand Down
23 changes: 11 additions & 12 deletions libmariadb/mariadb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,7 @@ my_context_install_suspend_resume_hook(struct mysql_async_context *b,
uint mysql_port=0;
my_string mysql_unix_port=0;

static char *mariadb_protocols[]= {"TCP",
#ifndef WIN32
"SOCKET",
#else
"PIPE", "MEMORY",
#endif
0};

#ifdef _WIN32
#define CONNECT_TIMEOUT 20
#else
#define CONNECT_TIMEOUT 0
#endif

struct st_mariadb_methods MARIADB_DEFAULT_METHODS;

Expand Down Expand Up @@ -3418,6 +3406,16 @@ const char * STDCALL mysql_sqlstate(MYSQL *mysql)
return mysql->net.sqlstate;
}

#ifndef _WIN32
#include <signal.h>
static void ignore_sigpipe()
{
signal(SIGPIPE, SIG_IGN);
}
#else
#define ignore_sigpipe()
#endif

#ifdef _WIN32
static int mysql_once_init()
#else
Expand Down Expand Up @@ -3459,6 +3457,7 @@ static void mysql_once_init()
}
if (!mysql_ps_subsystem_initialized)
mysql_init_ps_subsystem();
ignore_sigpipe();
mysql_client_init = 1;
#ifdef _WIN32
return 0;
Expand Down

0 comments on commit 1cefbbe

Please sign in to comment.