summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-18 05:04:57 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-18 05:04:57 +0000
commitfde551a2a5bf484f811359a9a5ce476c563263a9 (patch)
tree45129a3b1eed148c580c0df91083d3be8913abf8 /TAO/TAO_IDL/be
parentc2c68ea167b7e482823c0900c628b9a1bda77d21 (diff)
downloadATCD-fde551a2a5bf484f811359a9a5ce476c563263a9.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/TAO_IDL/be')
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp26
2 files changed, 18 insertions, 12 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 297b0fe5883..39dfba111e6 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -656,6 +656,7 @@ TAO_CodeGen::end_server_template_skeletons (void)
void
TAO_CodeGen::gperf_input_stream (TAO_OutStream *os)
{
+ delete this->gperf_input_stream_;
this->gperf_input_stream_ = os;
}
@@ -668,7 +669,8 @@ TAO_CodeGen::gperf_input_stream (void)
void
TAO_CodeGen::gperf_input_filename (char *filename)
{
- this->gperf_input_filename_ = filename;
+ delete[] this->gperf_input_filename_;
+ this->gperf_input_filename_ = ACE::strnew (filename);
}
char *
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 95820bae0d4..eb5d351f4a4 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -923,7 +923,7 @@ be_interface::gen_operation_table (void)
// Add the gperf input header.
gen_gperf_input_header (ss);
-
+
// Traverse the graph.
if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, ss) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -944,12 +944,10 @@ be_interface::gen_operation_table (void)
<< "::_non_existent_skel\n";
this->skel_count_++;
- // Input to the gperf is ready. Run gperf and get things done.
+ // Input to the gperf is ready. Run gperf and get things
+ // done. This method also unlinks the temp file that we used
+ // for the gperf.
gen_perfect_hash_optable ();
-
- // Cleanup the temp file. Delete the stream, remove the file
- // and delete the filename ptr.
- cleanup_gperf_temp_file ();
}
break;
@@ -1342,21 +1340,25 @@ be_interface::gen_perfect_hash_methods (void)
// Set the stdin and stdout appropriately for the gperf program.
- // Stdin is our temp file. Close the temp file and open using
- // ACE_OS::open so that we will get ACE_HANDLE.
+ // Stdin is our temp file. Close the temp file and open. We will use
+ // <open_temp_file> to open the file now, so that the file will get
+ // deleted once when we close the file.
+ // Close the file.
if (ACE_OS::fclose (cg->gperf_input_stream ()->file ()) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p:File close failed on temp gperf's input file\n"),
-1);
- ACE_HANDLE input = ACE_OS::open (cg->gperf_input_filename (),
- O_RDONLY);
+ // Open the temp file.
+ ACE_HANDLE input = ACE::open_temp_file (cg->gperf_input_filename (),
+ O_RDONLY);
+
if (input == ACE_INVALID_HANDLE)
ACE_ERROR_RETURN ((LM_ERROR,
"%p:File open failed on gperf's temp input file\n"),
-1);
-
+
// Stdout is server skeleton. Do *not* close the file, just open
// again with ACE_OS::open with WRITE + APPEND option.. After this,
// remember to update the file offset to the correct location.
@@ -1424,6 +1426,7 @@ be_interface::gen_perfect_hash_instance ()
<< be_nl;
}
+#if 0
// Delete the stream and filename for this temp file and also remove
// the temperary gperf's input file.
void
@@ -1451,6 +1454,7 @@ be_interface::cleanup_gperf_temp_file (void)
char *fname = cg->gperf_input_filename ();
delete[] fname;
}
+#endif /* 0 */
int
be_interface::is_a_helper (be_interface * /*derived*/,