~knielsen/maria/mysql-5.1.50-libmysqld.so

« back to all changes in this revision

Viewing changes to mysys/my_redel.c

  • Committer: Georgi Kodinov
  • Date: 2010-07-21 15:54:11 UTC
  • mfrom: (3457.1.42 merge-5.1-bugteam)
  • Revision ID: georgi.kodinov@oracle.com-20100721155411-8bpmhkpnazzsbfws
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
int my_copystat(const char *from, const char *to, int MyFlags)
77
77
{
78
78
  struct stat statbuf;
79
 
#if !defined(__WIN__) && !defined(__NETWARE__)
80
 
  int res;
81
 
#endif
82
79
 
83
 
  if (stat((char*) from, &statbuf))
 
80
  if (stat(from, &statbuf))
84
81
  {
85
82
    my_errno=errno;
86
83
    if (MyFlags & (MY_FAE+MY_WME))
89
86
  }
90
87
  if ((statbuf.st_mode & S_IFMT) != S_IFREG)
91
88
    return 1;
92
 
  VOID(chmod(to, statbuf.st_mode & 07777));             /* Copy modes */
 
89
 
 
90
  /* Copy modes */
 
91
  if (chmod(to, statbuf.st_mode & 07777))
 
92
  {
 
93
    my_errno= errno;
 
94
    if (MyFlags & (MY_FAE+MY_WME))
 
95
      my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno);
 
96
    return -1;
 
97
  }
93
98
 
94
99
#if !defined(__WIN__) && !defined(__NETWARE__)
95
100
  if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING)
97
102
    if (MyFlags & MY_LINK_WARNING)
98
103
      my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink);
99
104
  }
100
 
  res= chown(to, statbuf.st_uid, statbuf.st_gid);       /* Copy ownership */
 
105
  /* Copy ownership */
 
106
  if (chown(to, statbuf.st_uid, statbuf.st_gid))
 
107
  {
 
108
    my_errno= errno;
 
109
    if (MyFlags & (MY_FAE+MY_WME))
 
110
      my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno);
 
111
    return -1;
 
112
  }
101
113
#endif /* !__WIN__ && !__NETWARE__ */
102
114
 
103
115
#ifndef VMS