~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log.cc

  • Committer: Brian Aker
  • Date: 2008-12-09 17:33:02 UTC
  • mfrom: (656.1.54 devel)
  • Revision ID: brian@tangent.org-20081209173302-aptngvc7efxnatnt
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
474
474
 
475
475
  init(log_type_arg, io_cache_type_arg);
476
476
 
477
 
  if (!(name= my_strdup(log_name, MYF(MY_WME))))
 
477
  if (!(name= strdup(log_name)))
478
478
  {
479
479
    name= (char *)log_name; // for the error message
480
480
    goto err;
495
495
  if ((file= my_open(log_file_name, open_flags,
496
496
                     MYF(MY_WME | ME_WAITTANG))) < 0 ||
497
497
      init_io_cache(&log_file, file, IO_SIZE, io_cache_type,
498
 
                    my_tell(file), 0,
 
498
                    lseek(file, 0, SEEK_CUR), 0,
499
499
                    MYF(MY_WME | MY_NABP |
500
500
                        ((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0))))
501
501
    goto err;
737
737
       my_sync(index_file_nr, MYF(MY_WME)) ||
738
738
       init_io_cache(&index_file, index_file_nr,
739
739
                     IO_SIZE, WRITE_CACHE,
740
 
                     my_seek(index_file_nr,0L,MY_SEEK_END,MYF(0)),
 
740
                     lseek(index_file_nr,0,SEEK_END),
741
741
                        0, MYF(MY_WME | MY_WAIT_IF_FULL)))
742
742
  {
743
743
    /*
945
945
 
946
946
  for (;; offset+= bytes_read)
947
947
  {
948
 
    (void) my_seek(file, offset, MY_SEEK_SET, MYF(0));
 
948
    (void) lseek(file, offset, SEEK_SET);
949
949
    if ((bytes_read= (int) my_read(file, io_buf, sizeof(io_buf), MYF(MY_WME)))
950
950
        < 0)
951
951
      goto err;
952
952
    if (!bytes_read)
953
953
      break;                                    // end of file
954
 
    (void) my_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0));
 
954
    (void) lseek(file, offset-init_offset, SEEK_SET);
955
955
    if (my_write(file, io_buf, bytes_read, MYF(MY_WME | MY_NABP)))
956
956
      goto err;
957
957
  }
2550
2550
                      "--tc-heuristic-recover is used"));
2551
2551
      goto err;
2552
2552
    }
2553
 
    file_length= my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE));
2554
 
    if (file_length == MY_FILEPOS_ERROR || file_length % tc_log_page_size)
 
2553
    file_length= lseek(fd, 0, SEEK_END);
 
2554
    if (file_length == OFF_T_MAX || file_length % tc_log_page_size)
2555
2555
      goto err;
2556
2556
  }
2557
2557