示例#1
0
文件: jassert.cpp 项目: tkolhar/dmtcp
void jassert_internal::set_log_file ( const jalib::string& path )
{
  theLogFilePath() = path;
  if ( theLogFileFd != -1 ) jalib::close ( theLogFileFd );
  theLogFileFd = -1;
  if ( path.length() > 0 )
  {
    theLogFileFd = _open_log_safe ( path, jalib::logFd );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_2", jalib::logFd );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_3", jalib::logFd );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_4", jalib::logFd );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_5", jalib::logFd );
  }
}
示例#2
0
void jassert_internal::set_log_file(const jalib::string& path,
                                    const jalib::string _tmpDir,
                                    const jalib::string& _uniquePidStr)
{
  tmpDir() = _tmpDir;
  uniquePidStr() = _uniquePidStr;

  theLogFilePath() = path;
  if ( theLogFileFd != -1 ) jalib::close ( theLogFileFd );
  theLogFileFd = -1;
  if ( path.length() > 0 )
  {
    theLogFileFd = _open_log_safe ( path, jalib::logFd() );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_2", jalib::logFd() );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_3", jalib::logFd() );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_4", jalib::logFd() );
    if ( theLogFileFd == -1 )
      theLogFileFd = _open_log_safe ( path + "_5", jalib::logFd() );
  }
}
示例#3
0
static int _open_log_safe ( const jalib::string& s, int protectedFd )
{
  return _open_log_safe ( s.c_str(), protectedFd );
}
jalib::JBinarySerializeReader::JBinarySerializeReader ( const jalib::string& path )
  : JBinarySerializeReaderRaw ( path , jalib::open ( path.c_str(), O_RDONLY, 0 ) )
{}
jalib::JBinarySerializeWriter::JBinarySerializeWriter ( const jalib::string& path )
  : JBinarySerializeWriterRaw ( path , jalib::open ( path.c_str(), O_CREAT|O_WRONLY|O_TRUNC, 0600) )
{}