~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rename.cc

  • Committer: Brian Aker
  • Date: 2010-08-13 18:47:31 UTC
  • mfrom: (1707.1.7 rollup)
  • Revision ID: brian@tangent.org-20100813184731-w2iu1wzs219nqmt6
Style fixes/etc in heap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
int heap_rename(const char *old_name, const char *new_name)
25
25
{
26
 
  register HP_SHARE *info;
27
 
  char *name_buff;
 
26
  HP_SHARE *info;
28
27
 
29
28
  THR_LOCK_heap.lock();
30
29
  if ((info = hp_find_named_heap(old_name)))
31
30
  {
32
 
    if (!(name_buff=(char*) strdup(new_name)))
33
 
    {
34
 
      THR_LOCK_heap.unlock();
35
 
      return(errno);
36
 
    }
37
 
    free(info->name);
38
 
    info->name=name_buff;
 
31
    info->name.clear();
 
32
    info->name.append(new_name);
39
33
  }
40
34
  THR_LOCK_heap.unlock();
41
35
  return(0);