mirror of
https://github.com/MariaDB/server.git
synced 2025-03-28 09:55:34 +01:00
Portability fixes
This commit is contained in:
parent
d89690e606
commit
0716bf4d0e
13 changed files with 38 additions and 19 deletions
extra
innobase
isam
libmysql
myisam
mysys
readline
sql
strings
|
@ -20,6 +20,9 @@
|
|||
#define RESOLVE_VERSION "2.0"
|
||||
|
||||
#include <global.h>
|
||||
#include <m_ctype.h>
|
||||
#include <my_sys.h>
|
||||
#include <m_string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#ifndef HAVE_BROKEN_NETINET_INCLUDES
|
||||
|
@ -27,8 +30,6 @@
|
|||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <m_ctype.h>
|
||||
#include <my_sys.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
|
||||
|
|
|
@ -817,7 +817,9 @@ try_again:
|
|||
return(TRUE);
|
||||
}
|
||||
#endif
|
||||
#ifdef __WIN__
|
||||
error_handling:
|
||||
#endif
|
||||
retry = os_file_handle_error(file, NULL);
|
||||
|
||||
if (retry) {
|
||||
|
@ -906,7 +908,9 @@ try_again:
|
|||
return(TRUE);
|
||||
}
|
||||
#endif
|
||||
#ifdef __WIN__
|
||||
error_handling:
|
||||
#endif
|
||||
retry = os_file_handle_error(file, name);
|
||||
|
||||
if (retry) {
|
||||
|
@ -1150,6 +1154,8 @@ os_aio_get_array_and_local_segment(
|
|||
/***********************************************************************
|
||||
Gets an integer value designating a specified aio array. This is used
|
||||
to give numbers to signals in Posix aio. */
|
||||
|
||||
#if !defined(WIN_ASYNC_IO) && defined(POSIX_ASYNC_IO)
|
||||
static
|
||||
ulint
|
||||
os_aio_get_array_no(
|
||||
|
@ -1203,6 +1209,7 @@ os_aio_get_array_from_no(
|
|||
return(NULL);
|
||||
}
|
||||
}
|
||||
#endif /* if !defined(WIN_ASYNC_IO) && defined(POSIX_ASYNC_IO) */
|
||||
|
||||
/***********************************************************************
|
||||
Requests for a slot in the aio array. If no slot is available, waits until
|
||||
|
@ -1955,7 +1962,7 @@ consecutive_loop:
|
|||
}
|
||||
}
|
||||
|
||||
srv_io_thread_op_info[global_segment] = "doing file i/o";
|
||||
srv_io_thread_op_info[global_segment] = (char*) "doing file i/o";
|
||||
|
||||
/* Do the i/o with ordinary, synchronous i/o functions: */
|
||||
if (slot->type == OS_FILE_WRITE) {
|
||||
|
@ -1967,7 +1974,7 @@ consecutive_loop:
|
|||
}
|
||||
|
||||
ut_a(ret);
|
||||
srv_io_thread_op_info[global_segment] = "file i/o done";
|
||||
srv_io_thread_op_info[global_segment] = (char*) "file i/o done";
|
||||
|
||||
/* printf("aio: %lu consecutive %lu:th segment, first offs %lu blocks\n",
|
||||
n_consecutive, global_segment, slot->offset
|
||||
|
@ -2024,7 +2031,7 @@ wait_for_io:
|
|||
|
||||
os_mutex_exit(array->mutex);
|
||||
|
||||
srv_io_thread_op_info[global_segment] = "waiting for i/o request";
|
||||
srv_io_thread_op_info[global_segment] = (char*) "waiting for i/o request";
|
||||
|
||||
os_event_wait(os_aio_segment_wait_events[global_segment]);
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ ut_malloc_low(
|
|||
fprintf(stderr,
|
||||
"InnoDB: Fatal error: cannot allocate %lu bytes of\n"
|
||||
"InnoDB: memory with malloc! Total allocated memory\n"
|
||||
"InnoDB: by InnoDB %lu bytes. Operating system errno: %lu\n"
|
||||
"InnoDB: by InnoDB %lu bytes. Operating system errno: %d\n"
|
||||
"InnoDB: Cannot continue operation!\n"
|
||||
"InnoDB: Check if you should increase the swap file or\n"
|
||||
"InnoDB: ulimits of your operating system.\n",
|
||||
|
@ -155,7 +155,7 @@ ut_free_all_mem(void)
|
|||
|
||||
os_fast_mutex_lock(&ut_list_mutex);
|
||||
|
||||
while (block = UT_LIST_GET_FIRST(ut_mem_block_list)) {
|
||||
while ((block = UT_LIST_GET_FIRST(ut_mem_block_list))) {
|
||||
|
||||
ut_a(block->magic_n == UT_MEM_MAGIC_N);
|
||||
ut_a(ut_total_allocated_memory >= block->size);
|
||||
|
|
|
@ -259,8 +259,9 @@ int nisam_create(const char *name,uint keys,N_KEYDEF *keyinfo,
|
|||
(pointer == 3 && reclength >= 256L) ? (ulong) NI_POS_ERROR :
|
||||
((ulong) reclength * (1L << (pointer*8)));
|
||||
share.base.max_key_file_length= (share.base.key_reflength == 3 ?
|
||||
NI_POS_ERROR :
|
||||
(1L << (share.base.key_reflength*8))*512);
|
||||
NI_POS_ERROR :
|
||||
(ulong)
|
||||
(1L << (share.base.key_reflength*8))*512);
|
||||
share.base.min_block_length=
|
||||
(share.base.pack_reclength+3 < N_EXTEND_BLOCK_LENGTH &&
|
||||
! share.base.blobs) ?
|
||||
|
|
|
@ -288,7 +288,7 @@ static void usage(void)
|
|||
-?, --help display this help and exit\n\
|
||||
-V, --version output version information and exit\n");
|
||||
print_defaults("my",load_default_groups);
|
||||
};
|
||||
}
|
||||
|
||||
/* reads options */
|
||||
/* Initiates DEBUG - but no debugging here ! */
|
||||
|
|
|
@ -38,8 +38,12 @@
|
|||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__)
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>
|
||||
#if !defined(alpha_linux_port)
|
||||
#include <netinet/tcp.h>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#undef GETPID /* For HPUX */
|
||||
#ifdef THREAD
|
||||
#define GETPID() (log_type == 1 ? myisam_pid : (long) my_thread_id());
|
||||
#define GETPID() (log_type == 1 ? (long) myisam_pid : (long) my_thread_id());
|
||||
#else
|
||||
#define GETPID() myisam_pid
|
||||
#endif
|
||||
|
|
|
@ -893,7 +893,8 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
|
|||
DBUG_RETURN(error != HA_ERR_END_OF_FILE);
|
||||
}
|
||||
|
||||
static int compare_huff_elements(void *not_used, byte *a, byte *b)
|
||||
static int compare_huff_elements(void *not_used __attribute__((unused)),
|
||||
byte *a, byte *b)
|
||||
{
|
||||
return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
|
||||
(*((my_off_t*) a) == *((my_off_t*) b) ? 0 : 1);
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
this, just remember the file name for later removal
|
||||
*/
|
||||
|
||||
static my_bool cache_remove_open_tmp(IO_CACHE *cache, const char *name)
|
||||
static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)),
|
||||
const char *name)
|
||||
{
|
||||
#if O_TEMPORARY == 0
|
||||
#if !defined(CANT_DELETE_OPEN_FILES)
|
||||
|
|
|
@ -138,7 +138,7 @@ _rl_vi_initialize_line ()
|
|||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++)
|
||||
for (i = 0; i < (int) sizeof (vi_mark_chars) / sizeof (int); i++)
|
||||
vi_mark_chars[i] = -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ innobase_mysql_print_thd(
|
|||
}
|
||||
|
||||
if (thd->query) {
|
||||
printf("\n%0.100s", thd->query);
|
||||
printf("\n%.100s", thd->query);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
|
|
@ -38,8 +38,12 @@
|
|||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__)
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>
|
||||
#if !defined(alpha_linux_port)
|
||||
#include <netinet/tcp.h>
|
||||
|
|
|
@ -123,7 +123,7 @@ enum l1_symbols {
|
|||
L1_SARA_AE,
|
||||
L1_SARA_O,
|
||||
L1_SARA_AI_MAIMUAN,
|
||||
L1_SARA_AI_MAIMALAI,
|
||||
L1_SARA_AI_MAIMALAI
|
||||
};
|
||||
|
||||
// level 2 symbols & order
|
||||
|
@ -137,7 +137,7 @@ enum l2_symbols {
|
|||
L2_TONE1,
|
||||
L2_TONE2,
|
||||
L2_TONE3,
|
||||
L2_TONE4,
|
||||
L2_TONE4
|
||||
};
|
||||
|
||||
// level 3 symbols & order
|
||||
|
@ -182,7 +182,7 @@ enum l3_symbols {
|
|||
L3_LESS_THAN,
|
||||
L3_EQUAL,
|
||||
L3_GREATER_THAN,
|
||||
L3_V_LINE,
|
||||
L3_V_LINE
|
||||
};
|
||||
|
||||
// level 4 symbols & order
|
||||
|
@ -190,7 +190,7 @@ enum l4_symbols {
|
|||
L4_BLANK = TOT_LEVELS,
|
||||
L4_MIN,
|
||||
L4_CAP,
|
||||
L4_EXT,
|
||||
L4_EXT
|
||||
};
|
||||
|
||||
enum level_symbols {
|
||||
|
|
Loading…
Add table
Reference in a new issue