~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/default_modify.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:
132
132
      if (reserve_occupied >= (int) reserve_extended)
133
133
      {
134
134
        reserve_extended= (uint) reserve_occupied + RESERVE;
135
 
        if (!(file_buffer= (char*) my_realloc(file_buffer, buffer_size +
136
 
                                              reserve_extended,
137
 
                                              MYF(MY_WME|MY_FREE_ON_ERROR))))
 
135
        if (!(file_buffer= (char*) realloc(file_buffer, buffer_size +
 
136
                                           reserve_extended)))
138
137
          goto malloc_err;
139
138
      }
140
139
      opt_applied= 1;
210
209
  if (opt_applied)
211
210
  {
212
211
    /* Don't write the file if there are no changes to be made */
213
 
    if (ftruncate(fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer)) ||
214
 
        my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) ||
215
 
        my_fwrite(cnf_file, (unsigned char*) file_buffer, (size_t) (dst_ptr - file_buffer),
216
 
                  MYF(MY_NABP)))
 
212
    if (ftruncate(fileno(cnf_file), (size_t) (dst_ptr - file_buffer)) ||
 
213
        fseeko(cnf_file, 0, SEEK_SET) ||
 
214
        fwrite(file_buffer, 1, (size_t) (dst_ptr - file_buffer), cnf_file))
217
215
      goto err;
218
216
  }
219
217
  if (my_fclose(cnf_file, MYF(MY_WME)))