1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

WL #1034 (Internal CRON) post-push update

- fix compile failure on QNX and FreeBSD


sql/event_executor.cc:
  time_t and my_time_t seem have the same length so cast
  in tztime.cc it's already done this way.
  Precautionary check at runtime about the sizes of my_time_t and time_t
sql/event_timed.cc:
  do time_t* cast to satisfy compilers on various platforms
  (QNX, FreeBSD)
This commit is contained in:
unknown
2006-01-12 16:51:45 +01:00
parent a80cfc9e1a
commit eb2012034c
2 changed files with 11 additions and 4 deletions

View File

@ -183,13 +183,20 @@ event_executor_main(void *arg)
// needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
my_thread_init();
if (sizeof(my_time_t) != sizeof(time_t))
{
sql_print_error("sizeof(my_time_t) != sizeof(time_t) ."
"The scheduler will not work correctly. Stopping.");
goto err_no_thd;
}
//TODO Andrey: Check for NULL
if (!(thd = new THD)) // note that contructor of THD uses DBUG_ !
{
sql_print_error("Cannot create THD for event_executor_main");
goto err_no_thd;
}
}
thd->thread_stack = (char*)&thd; // remember where our stack is
pthread_detach_this_thread();
@ -275,7 +282,7 @@ event_executor_main(void *arg)
}
DBUG_PRINT("evex main thread",("computing time to sleep till next exec"));
time(&now);
time((time_t *)&now);
my_tz_UTC->gmt_sec_to_TIME(&time_now, now);
t2sleep= evex_time_diff(&et->execute_at, &time_now);
VOID(pthread_mutex_unlock(&LOCK_event_arrays));