~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_symlink.c

  • Committer: Jay Pipes
  • Date: 2008-07-17 20:11:46 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: jay@mysql.com-20080717201146-s2flcwwq0q89ac1y
Phase 3 removal of DBUG in mysys

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#else
41
41
  int result=0;
42
42
  int length;
43
 
  DBUG_ENTER("my_readlink");
44
43
 
45
44
  if ((length=readlink(filename, to, FN_REFLEN-1)) < 0)
46
45
  {
59
58
  }
60
59
  else
61
60
    to[length]=0;
62
 
  DBUG_PRINT("exit" ,("result: %d", result));
63
 
  DBUG_RETURN(result);
 
61
  return(result);
64
62
#endif /* HAVE_READLINK */
65
63
}
66
64
 
73
71
  return 0;
74
72
#else
75
73
  int result;
76
 
  DBUG_ENTER("my_symlink");
77
 
  DBUG_PRINT("enter",("content: %s  linkname: %s", content, linkname));
78
74
 
79
75
  result= 0;
80
76
  if (symlink(content, linkname))
86
82
  }
87
83
  else if ((MyFlags & MY_SYNC_DIR) && my_sync_dir_by_file(linkname, MyFlags))
88
84
    result= -1;
89
 
  DBUG_RETURN(result);
 
85
  return(result);
90
86
#endif /* HAVE_READLINK */
91
87
}
92
88
 
115
111
  int result=0;
116
112
  char buff[BUFF_LEN];
117
113
  struct stat stat_buff;
118
 
  DBUG_ENTER("my_realpath");
119
114
 
120
115
  if (!(MyFlags & MY_RESOLVE_LINK) ||
121
116
      (!lstat(filename,&stat_buff) && S_ISLNK(stat_buff.st_mode)))
122
117
  {
123
118
    char *ptr;
124
 
    DBUG_PRINT("info",("executing realpath"));
125
119
    if ((ptr=realpath(filename,buff)))
126
120
    {
127
121
      strmake(to,ptr,FN_REFLEN-1);
133
127
        original name but will at least be able to resolve paths that starts
134
128
        with '.'.
135
129
      */
136
 
      DBUG_PRINT("error",("realpath failed with errno: %d", errno));
137
130
      my_errno=errno;
138
131
      if (MyFlags & MY_WME)
139
132
        my_error(EE_REALPATH, MYF(0), filename, my_errno);
141
134
      result= -1;
142
135
    }
143
136
  }
144
 
  DBUG_RETURN(result);
 
137
  return(result);
145
138
#else
146
139
  my_load_path(to, filename, NullS);
147
140
  return 0;