~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/slave.cc

  • Committer: Monty Taylor
  • Date: 2008-12-17 18:23:08 UTC
  • mfrom: (685.3.3 mysys-slimdown)
  • mto: This revision was merged to the branch mainline in revision 713.
  • Revision ID: monty@inaugust.com-20081217182308-bcuztplharskm9yh
MergedĀ fromĀ Toru.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1362
1362
  return(0);
1363
1363
}
1364
1364
 
1365
 
 
 
1365
/* Returns non zero on error */
1366
1366
static int32_t safe_sleep(Session* session, int32_t sec, CHECK_KILLED_FUNC thread_killed,
1367
 
                      void* thread_killed_arg)
 
1367
                          void* thread_killed_arg)
1368
1368
{
1369
1369
  int32_t nap_time;
1370
1370
  thr_alarm_t alarmed;
1371
1371
 
1372
1372
  thr_alarm_init(&alarmed);
1373
 
  time_t start_time= my_time(0);
1374
 
  time_t end_time= start_time+sec;
 
1373
  time_t start_time, end_time;
 
1374
 
 
1375
  if ((start_time= time(0)) == (time_t)-1)
 
1376
    return -1;
 
1377
  end_time= start_time+sec;
1375
1378
 
1376
1379
  while ((nap_time= (int32_t) (end_time - start_time)) > 0)
1377
1380
  {
1387
1390
 
1388
1391
    if ((*thread_killed)(session,thread_killed_arg))
1389
1392
      return(1);
1390
 
    start_time= my_time(0);
 
1393
    if ((start_time= time(0)) == (time_t)-1)
 
1394
      return -1;
1391
1395
  }
1392
1396
  return(0);
1393
1397
}
1604
1608
  session->set_time();                            // time the query
1605
1609
  session->lex->current_select= 0;
1606
1610
  if (!ev->when)
1607
 
    ev->when= my_time(0);
 
1611
    if((ev->when= time(0)) == (time_t)-1)
 
1612
      return 2;
 
1613
 
1608
1614
  ev->session = session; // because up to this point, ev->session == 0
1609
1615
 
1610
1616
  if (skip)