summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
index 403e105bf7d..c7de112dd11 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
@@ -5,6 +5,7 @@
//-----------------------------------------------------------------------------
#include "orbsvcs/Naming/Flat_File_Persistence.h"
+#include "ace/config-all.h"
#include "ace/Log_Msg.h"
#include "ace/OS_NS_sys_stat.h"
#include "ace/OS_NS_unistd.h"
@@ -32,7 +33,7 @@ void
TAO_NS_FlatFileStream::remove ()
{
ACE_TRACE("remove");
- ACE_OS::unlink(ACE_TEXT_CHAR_TO_TCHAR(file_.c_str()));
+ ACE_OS::unlink(ACE_TEXT_TO_TCHAR_IN(file_.c_str()));
}
int
@@ -60,21 +61,21 @@ TAO_NS_FlatFileStream::open()
if( strchr(mode_.c_str(), 'c') )
flags |= O_CREAT;
#ifndef ACE_WIN32
- if( ACE_OS::flock_init (&filelock_, flags, ACE_TEXT_CHAR_TO_TCHAR(file_.c_str()), 0666) != 0 )
+ if( ACE_OS::flock_init (&filelock_, flags, ACE_TEXT_TO_TCHAR_IN(file_.c_str()), 0666) != 0 )
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open file %s for mode %s: (%d) %s\n",
file_.c_str(), mode_.c_str(),
errno, ACE_OS::strerror(errno)),
-1);
#else
- if( (filelock_.handle_= ACE_OS::open (ACE_TEXT_CHAR_TO_TCHAR(file_.c_str()), flags, 0)) == ACE_INVALID_HANDLE )
+ if( (filelock_.handle_= ACE_OS::open (ACE_TEXT_TO_TCHAR_IN(file_.c_str()), flags, 0)) == ACE_INVALID_HANDLE )
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open file %s for mode %s: (%d) %s\n",
file_.c_str(), mode_.c_str(),
errno, ACE_OS::strerror(errno)),
-1);
#endif
- this->fl_ = ACE_OS::fdopen(filelock_.handle_, ACE_TEXT_CHAR_TO_TCHAR(fdmode));
+ this->fl_ = ACE_OS::fdopen(filelock_.handle_, ACE_TEXT_TO_TCHAR_IN(fdmode));
if (this->fl_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot fdopen file %s for mode %s: (%d) %s\n",
@@ -247,9 +248,7 @@ TAO_NS_FlatFileStream::operator >>(
return *this;
}
char *id = new char[bufSize+1];
- //char *id;
- //ACE_NEW_RETURN (id, char[bufSize+1], 1);
- if (ACE_OS::fgets(ACE_TEXT_CHAR_TO_TCHAR(id), bufSize+1, fl_) == 0 &&
+ if (ACE_OS::fgets(id, bufSize+1, fl_) == 0 &&
bufSize != 0)
{
this->setstate (badbit);
@@ -270,9 +269,7 @@ TAO_NS_FlatFileStream::operator >>(
return *this;
}
char *kind = new char[bufSize+1];
- //char *kind;
- //ACE_NEW (kind, char[bufSize+1]);
- if (ACE_OS::fgets(ACE_TEXT_CHAR_TO_TCHAR(kind), bufSize+1, fl_) == 0 &&
+ if (ACE_OS::fgets(kind, bufSize+1, fl_) == 0 &&
bufSize != 0)
{
this->setstate (badbit);
@@ -294,9 +291,7 @@ TAO_NS_FlatFileStream::operator >>(
return *this;
}
char *ref = new char[bufSize+1];
- //char *ref;
- //ACE_NEW(ref, char[bufSize+1]);
- if (ACE_OS::fgets(ACE_TEXT_CHAR_TO_TCHAR(ref), bufSize+1, fl_) == 0 &&
+ if (ACE_OS::fgets(ref, bufSize+1, fl_) == 0 &&
bufSize != 0)
{
this->setstate (badbit);
@@ -354,7 +349,7 @@ TAO_NS_FlatFileFactory::create_stream (const ACE_CString & file,
TAO_Storable_Base *stream = 0;
ACE_NEW_RETURN (stream,
- TAO_NS_FlatFileStream(file, ACE_TEXT_ALWAYS_CHAR (mode)),
+ TAO_NS_FlatFileStream(file, ACE_TEXT_TO_CHAR_IN (mode)),
0);
return stream;
}