~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_redel.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-21 01:02:23 UTC
  • mto: (960.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 961.
  • Revision ID: osullivan.padraig@gmail.com-20090321010223-j8cph7eeyt1u3xol
Fixed function object to ensure it correctly returns a boolean type since
memcmp returns an integer. Added some more comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "mysys_priv.h"
17
 
#include <my_dir.h>
18
17
#include <mystrings/m_string.h>
19
18
#include "mysys_err.h"
20
19
#if defined(HAVE_UTIME_H)
47
46
    goto end;
48
47
  if (MyFlags & MY_REDEL_MAKE_BACKUP)
49
48
  {
50
 
    char name_buff[FN_REFLEN+20];    
 
49
    char name_buff[FN_REFLEN+20];
51
50
    char ext[20];
52
51
    ext[0]='-';
53
52
    get_date(ext+1,2+4,(time_t) 0);
54
 
    my_stpcpy(strchr(ext, '\0'),REDEL_EXT);
 
53
    strcpy(strchr(ext, '\0'),REDEL_EXT);
55
54
    if (my_rename(org_name, fn_format(name_buff, org_name, "", ext, 2),
56
55
                  MyFlags))
57
56
      goto end;
90
89
    if (MyFlags & MY_LINK_WARNING)
91
90
      my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink);
92
91
  }
93
 
  chown(to, statbuf.st_uid, statbuf.st_gid);    /* Copy ownership */
 
92
  if(chown(to, statbuf.st_uid, statbuf.st_gid)!=0)
 
93
    return 1;
94
94
 
95
95
#ifndef __ZTC__
96
96
  if (MyFlags & MY_COPYTIME)