summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-07-22 17:11:09 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-07-22 17:11:09 +0000
commite619ba44768917051c6ebaad47e0af4e8439650b (patch)
tree9441b1cc3e8eca9b0b9aeb8fa243b958c32b5d07 /TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
parent4c2d55d16769f3a741b2f4f38d540835dc8fba7e (diff)
downloadATCD-e619ba44768917051c6ebaad47e0af4e8439650b.tar.gz
ChangeLogTag: Tue Jul 22 17:04:23 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp47
1 files changed, 11 insertions, 36 deletions
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
index 32f314e4dfd..9517755e291 100644
--- a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
@@ -331,53 +331,28 @@ TAO_IFR_Server::create_repository (void)
// Add the repository to the ORB's table of initialized object references.
this->orb_->register_initial_reference ("InterfaceRepository",
repo_ref);
-
- const char *ior_filename = OPTIONS::instance ()->ior_output_file ();
- ACE_HANDLE fd = ACE_OS::open (ior_filename,
- O_RDWR | O_CREAT | O_TRUNC,
- ACE_DEFAULT_FILE_PERMS);
- if (fd == ACE_INVALID_HANDLE)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_IFR_Server::create_repository - ",
- "ACE_OS::open() failed\n"),
- -1);
- }
-
- const char *ifr_ior = this->ifr_ior_.in ();
- size_t ior_size = ACE_OS::strlen (ifr_ior) + 1;
- ssize_t result = ACE_OS::write (fd, ifr_ior, ior_size);
+ // Write our IOR to a file.
- if (result != static_cast<ssize_t> (ior_size))
- {
- ACE_OS::unlink (ior_filename);
- ACE_OS::close (fd);
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_IFR_Server::create_repository - ",
- "ACE_OS::write() failed\n"),
- -1);
- }
-
- if (ACE_OS::close (fd) != 0)
+ FILE *output_file_ =
+ ACE_OS::fopen (OPTIONS::instance ()->ior_output_file (),
+ ACE_TEXT ("w"));
+
+ if (output_file_ == 0)
{
- ACE_OS::unlink (ior_filename);
ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_IFR_Server::create_repository - ",
- ACE_TEXT ("ACE_OS::close() failed\n")),
+ ACE_TEXT ("TAO_IFR_Server::create_repository - ")
+ ACE_TEXT ("can't open IOR output ")
+ ACE_TEXT ("file for writing\n")),
-1);
}
-/*
- FILE *output_file_ =
- ACE_OS::fopen (OPTIONS::instance()->ior_output_file (),
- "w");
ACE_OS::fprintf (output_file_,
- "%s",
+ "%s\n",
this->ifr_ior_.in ());
ACE_OS::fclose (output_file_);
-*/
+
return 0;
}