Commit 2d09c5bf authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

Portability fixes

parent 9257a27c
......@@ -369,6 +369,14 @@ el_line(EditLine *el)
static const char elpath[] = "/.editrc";
#if defined(MAXPATHLEN)
#define LIBEDIT_MAXPATHLEN MAXPATHLEN
#elif defined(PATH_MAX)
#define LIBEDIT_MAXPATHLEN PATH_MAX
#else
#define LIBEDIT_MAXPATHLEN 1024
#endif
/* el_source():
* Source a file
*/
......@@ -377,7 +385,7 @@ el_source(EditLine *el, const char *fname)
{
FILE *fp;
size_t len;
char *ptr, path[MAXPATHLEN];
char *ptr, path[LIBEDIT_MAXPATHLEN];
fp = NULL;
if (fname == NULL) {
......
......@@ -701,11 +701,8 @@ AC_SUBST(MYSQLD_USER)
# If we should allow LOAD DATA LOCAL
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
AC_ARG_ENABLE(local-infile,
Enable LOAD DATA LOCAL INFILE (default: disabled)],
[
ENABLED_LOCAL_INFILE=$enableval
AC_DEFINE(ENABLED_LOCAL_INFILE)
],
[ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
[ ENABLED_LOCAL_INFILE=$enableval ],
[ ENABLED_LOCAL_INFILE=no ]
)
if test "$ENABLED_LOCAL_INFILE" = "yes"
......@@ -1734,26 +1731,14 @@ MYSQL_PTHREAD_YIELD
# For readline/libedit (We simply move the mimimum amount of stuff from
# the readline/libedit configure.in here)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h malloc.h sys/ioctl.h unistd.h sys/cdefs.h sys/types.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(re_comp regcomp strdup strerror strstr strtol)
AC_CHECK_FUNCS(re_comp regcomp strdup)
AC_CHECK_HEADERS(vis.h)
AC_CHECK_FUNCS(strlcat strlcpy)
......
......@@ -2039,6 +2039,20 @@ static int init_common_variables(const char *conf_file_name, int argc,
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
{
/* Retrieve used stack size; Needed for checking stack overflows */
size_t stack_size;
pthread_attr_getstacksize(&connection_attrib, &stack_size);
if (global_system_variables.log_warnings && stack_size != thread_stack)
{
sql_print_error("Warning: Asked for %ld thread stack, but got %ld",
thread_stack, stack_size);
thread_stack= stack_size;
}
}
#endif
#if defined( SET_RLIMIT_NOFILE) || defined( OS2)
/* connections and databases needs lots of files */
{
......@@ -2349,19 +2363,6 @@ int main(int argc, char **argv)
if (!(opt_specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),CONNECT_PRIOR);
pthread_attr_setstacksize(&connection_attrib,thread_stack);
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
{
/* Retrieve used stack size; Needed for checking stack overflows */
size_t stack_size;
pthread_attr_getstacksize(&connection_attrib, &stack_size);
if (global_system_variables.log_warnings && stack_size != thread_stack)
{
sql_print_error("Warning: Asked for %ld thread stack, but got %ld",
thread_stack, stack_size);
thread_stack= stack_size;
}
}
#endif
(void) thr_setconcurrency(concurrency); // 10 by default
select_thread=pthread_self();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment