~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_tempfile.c

  • Committer: Brian Aker
  • Date: 2008-07-18 20:10:26 UTC
  • mfrom: (51.3.29 remove-dbug)
  • Revision ID: brian@tangent.org-20080718201026-tto5golt0xhwqe4a
Merging in Jay's final patch on dbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
{
61
61
  File file= -1;
62
62
 
63
 
  DBUG_ENTER("create_temp_file");
64
 
  DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir, prefix));
65
63
#if defined(_ZTC__)
66
64
  if (!dir)
67
65
    dir=getenv("TMPDIR");
86
84
    if (strlen(dir)+ pfx_len > FN_REFLEN-2)
87
85
    {
88
86
      errno=my_errno= ENAMETOOLONG;
89
 
      DBUG_RETURN(file);
 
87
      return(file);
90
88
    }
91
89
    strmov(convert_dirname(to,dir,NullS),prefix_buff);
92
90
    org_file=mkstemp(to);
128
126
                     MYF(MY_WME));
129
127
 
130
128
    }
131
 
    else
132
 
    {
133
 
      DBUG_PRINT("error",("Got error: %d from tempnam",errno));
134
 
    }
135
129
    environ=(const char**) old_env;
136
130
  }
137
131
#else
139
133
#endif
140
134
  if (file >= 0)
141
135
    thread_safe_increment(my_tmp_file_created,&THR_LOCK_open);
142
 
  DBUG_RETURN(file);
 
136
  return(file);
143
137
}