~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_copy.c

  • Committer: Stewart Smith
  • Date: 2008-06-30 05:33:25 UTC
  • mfrom: (12.2.8 drizzle)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: stewart@flamingspork.com-20080630053325-mwrv6bjaufcpvj8n
merge my work

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
  int create_flag;
56
56
  File from_file,to_file;
57
57
  uchar buff[IO_SIZE];
58
 
  MY_STAT stat_buff,new_stat_buff;
 
58
  struct stat stat_buff,new_stat_buff;
59
59
  DBUG_ENTER("my_copy");
60
60
  DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
61
61
 
62
62
  from_file=to_file= -1;
63
63
  DBUG_ASSERT(!(MyFlags & (MY_FNABP | MY_NABP))); /* for my_read/my_write */
64
64
  if (MyFlags & MY_HOLD_ORIGINAL_MODES)         /* Copy stat if possible */
65
 
    new_file_stat= test(my_stat((char*) to, &new_stat_buff, MYF(0)));
 
65
    new_file_stat= test(!stat((char*) to, &new_stat_buff));
66
66
 
67
67
  if ((from_file=my_open(from,O_RDONLY | O_SHARE,MyFlags)) >= 0)
68
68
  {
69
 
    if (!my_stat(from, &stat_buff, MyFlags))
 
69
    if (stat(from, &stat_buff))
70
70
    {
71
71
      my_errno=errno;
72
72
      goto err;