Skip to content

Commit

Permalink
Posix-only fix for CORE-3600: temp files fb_query_xxxx remains after …
Browse files Browse the repository at this point in the history
…ISQL has been closed
  • Loading branch information
AlexPeshkoff committed Oct 5, 2011
1 parent acc4af9 commit af4d1d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gpre/gpre.cpp
Expand Up @@ -1335,6 +1335,9 @@ static SLONG compile_module( SLONG start_position, const TEXT* base_directory)
const Firebird::PathName filename = Firebird::TempFile::create(SCRATCH);
strcpy(trace_file_name, filename.c_str());
trace_file = fopen(trace_file_name, "w+b");
#ifdef UNIX
unlink(trace_file_name);
#endif

if (!trace_file)
{
Expand Down
3 changes: 3 additions & 0 deletions src/isql/isql.epp
Expand Up @@ -4137,6 +4137,9 @@ static void do_isql()
const Firebird::PathName filename = TempFile::create(SCRATCH);
const char* Tmpfile = filename.c_str();
FILE* f = fopen(Tmpfile, "w+"); // It was w+b
#ifdef UNIX
unlink(Tmpfile);
#endif
if (f)
Filelist->Ofp().init(f, Tmpfile, Tmpfile);
else
Expand Down
3 changes: 3 additions & 0 deletions src/qli/lex.cpp
Expand Up @@ -512,6 +512,9 @@ void LEX_init()
const Firebird::PathName filename = TempFile::create(SCRATCH);
strcpy(trace_file_name, filename.c_str());
trace_file = fopen(trace_file_name, "w+b");
#ifdef UNIX
unlink(trace_file_name);
#endif
if (!trace_file)
IBERROR(61); // Msg 61 couldn't open scratch file

Expand Down

0 comments on commit af4d1d8

Please sign in to comment.