File tree Expand file tree Collapse file tree 3 files changed +14
-21
lines changed Expand file tree Collapse file tree 3 files changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -3645,9 +3645,7 @@ innobase_init(
36453645
36463646#ifndef UNIV_HOTBACKUP
36473647#ifdef _WIN32
3648- if (ut_win_init_time()) {
3649- goto mem_free_and_error;
3650- }
3648+ ut_win_init_time();
36513649#endif /* _WIN32 */
36523650#endif /* !UNIV_HOTBACKUP */
36533651
Original file line number Diff line number Diff line change @@ -275,9 +275,10 @@ ut_time_ms(void);
275275/* ============*/
276276#ifdef _WIN32
277277/* *********************************************************/ /* *
278- Initialise highest available time resolution API on Windows
279- @return 0 if all OK else -1 */
280- int
278+ Initialise highest available time resolution API on Windows.
279+ Crashes if there's an error loading kernel32.dll.
280+ */
281+ void
281282ut_win_init_time ();
282283
283284#endif /* _WIN32 */
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ Created 5/11/1994 Heikki Tuuri
4949UNIV_INTERN ibool ut_always_false = FALSE ;
5050
5151#ifdef __WIN__
52- #include < mysql/innodb_priv.h> /* For sql_print_error */
5352typedef VOID (WINAPI *time_fn)(LPFILETIME);
5453static time_fn ut_get_system_time_as_file_time = GetSystemTimeAsFileTime;
5554
@@ -61,25 +60,20 @@ epoch starts from 1970/1/1. For selection of constant see:
6160
6261
6362/* *
64- Initialise highest available time resolution API on Windows
65- @return 0 if all OK else -1 */
66- int
63+ Initialise highest available time resolution API on Windows.
64+ Crashes if there's an error loading kernel32.dll.
65+ */
66+ void
6767ut_win_init_time ()
6868{
6969HMODULE h = LoadLibrary (" kernel32.dll" );
70- if (h != NULL )
70+ ut_a (h);
71+ time_fn pfn = (time_fn)GetProcAddress (h, " GetSystemTimePreciseAsFileTime" );
72+ if (pfn != NULL )
7173{
72- time_fn pfn = (time_fn)GetProcAddress (h, " GetSystemTimePreciseAsFileTime" );
73- if (pfn != NULL )
74- {
75- ut_get_system_time_as_file_time = pfn;
76- }
77- return false ;
74+ ut_get_system_time_as_file_time = pfn;
7875}
79- DWORD error = GetLastError ();
80- sql_print_error (
81- " LoadLibrary(\" kernel32.dll\" ) failed: GetLastError returns %lu" , error);
82- return (-1 );
76+ return ;
8377}
8478
8579/* ****************************************************************/ /* *
You can’t perform that action at this time.
0 commit comments