summaryrefslogtreecommitdiff
path: root/storage/innobase/os
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-02-20 21:17:36 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-02-20 21:17:36 +0000
commit56e7b7eaede52e8d2123e909d7d42220f8c63143 (patch)
tree73e1dc4b2e53d68c3a9d5269f9140142ef08c187 /storage/innobase/os
parent9d97e6010ebdeab0579a8371d01f34118c518b30 (diff)
downloadmariadb-git-56e7b7eaede52e8d2123e909d7d42220f8c63143.tar.gz
Make possible to use clang on Windows (clang-cl)
-DWITH_ASAN can be used as well now, on x64 Fix many clang-cl warnings.
Diffstat (limited to 'storage/innobase/os')
-rw-r--r--storage/innobase/os/os0event.cc12
-rw-r--r--storage/innobase/os/os0file.cc54
2 files changed, 4 insertions, 62 deletions
diff --git a/storage/innobase/os/os0event.cc b/storage/innobase/os/os0event.cc
index b687af3e21c..98b474c0bda 100644
--- a/storage/innobase/os/os0event.cc
+++ b/storage/innobase/os/os0event.cc
@@ -35,9 +35,6 @@ Created 2012-09-23 Sunny Bains
#include <list>
-/** The number of microsecnds in a second. */
-static const ulint MICROSECS_IN_A_SECOND = 1000000;
-
#ifdef _WIN32
/** Native condition variable. */
typedef CONDITION_VARIABLE os_cond_t;
@@ -381,13 +378,8 @@ os_event::wait_time_low(
tv.tv_usec += time_in_usec;
- if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) {
- tv.tv_sec += tv.tv_usec / MICROSECS_IN_A_SECOND;
- tv.tv_usec %= MICROSECS_IN_A_SECOND;
- }
-
- abstime.tv_sec = tv.tv_sec;
- abstime.tv_nsec = tv.tv_usec * 1000;
+ abstime.tv_sec = tv.tv_sec + tv.tv_usec / 1000000;
+ abstime.tv_nsec = tv.tv_usec % 1000000 * 1000;
} else {
abstime.tv_nsec = 999999999;
abstime.tv_sec = (time_t) ULINT_MAX;
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 942b512206f..b0f4b90b127 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -3401,16 +3401,6 @@ static void __stdcall win_free_syncio_event(void *data) {
/*
-Initialize tls index.for event handle used for synchronized IO on files that
-might be opened with FILE_FLAG_OVERLAPPED.
-*/
-static void win_init_syncio_event() {
- fls_sync_io = FlsAlloc(win_free_syncio_event);
- ut_a(fls_sync_io != FLS_OUT_OF_INDEXES);
-}
-
-
-/*
Retrieve per-thread event for doing synchronous io on asyncronously opened files
*/
static HANDLE win_get_syncio_event()
@@ -3515,46 +3505,6 @@ struct WinIoInit
/* Ensures proper initialization and shutdown */
static WinIoInit win_io_init;
-/** Check if the file system supports sparse files.
-@param[in] name File name
-@return true if the file system supports sparse files */
-static
-bool
-os_is_sparse_file_supported_win32(const char* filename)
-{
- char volname[MAX_PATH];
- BOOL result = GetVolumePathName(filename, volname, MAX_PATH);
-
- if (!result) {
-
- ib::error()
- << "os_is_sparse_file_supported: "
- << "Failed to get the volume path name for: "
- << filename
- << "- OS error number " << GetLastError();
-
- return(false);
- }
-
- DWORD flags;
-
- result = GetVolumeInformation(
- volname, NULL, MAX_PATH, NULL, NULL,
- &flags, NULL, MAX_PATH);
-
-
- if (!result) {
- ib::error()
- << "os_is_sparse_file_supported: "
- << "Failed to get the volume info for: "
- << volname
- << "- OS error number " << GetLastError();
-
- return(false);
- }
-
- return(flags & FILE_SUPPORTS_SPARSE_FILES) ? true : false;
-}
/** Free storage space associated with a section of the file.
@param[in] fh Open file handle
@@ -3851,7 +3801,7 @@ os_file_create_simple_func(
ib::info()
<< "Read only mode set. Unable to"
" open file '" << name << "' in RW mode, "
- << "trying RO mode", name;
+ << "trying RO mode";
access = GENERIC_READ;
@@ -4546,7 +4496,7 @@ bool
os_file_close_func(
os_file_t file)
{
- ut_a(file > 0);
+ ut_a(file);
if (CloseHandle(file)) {
return(true);