diff options
author | Pascal Junck <pjunck@openoffice.org> | 2004-11-03 11:43:17 +0000 |
---|---|---|
committer | Pascal Junck <pjunck@openoffice.org> | 2004-11-03 11:43:17 +0000 |
commit | e9e8f7fb21f4d01bc1380cba50d062b9c9e9dae0 (patch) | |
tree | 62140e280a13ce69af92b1ee5428b8ea697792ae /transex3 | |
parent | 804f0628ca659cf30694585de5a0be0339ab3c1a (diff) |
INTEGRATION: CWS hr8 (1.2.12); FILE MERGED
2004/11/02 19:10:20 ihi 1.2.12.2: Display error message when file creation failed and exit -1
2004/11/02 19:06:08 ihi 1.2.12.1: Display error message when file creation failed
Diffstat (limited to 'transex3')
-rw-r--r-- | transex3/source/xmlparse.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/transex3/source/xmlparse.cxx b/transex3/source/xmlparse.cxx index 639e806d8d31..84a42449b61e 100644 --- a/transex3/source/xmlparse.cxx +++ b/transex3/source/xmlparse.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlparse.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: pjunck $ $Date: 2004-11-02 16:05:30 $ + * last change: $Author: pjunck $ $Date: 2004-11-03 12:43:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,8 +74,6 @@ #include "xmlparse.hxx" - - // // class XMLChildNode // @@ -308,17 +306,25 @@ BOOL XMLFile::Write( String &rFileName ) /*****************************************************************************/ { if ( rFileName.Len()) { - //Sigfunc* hOldHandler = signal( SIGINT, &::Signal_handler ); - //signal(SIGINT,SIG_IGN); // Disable Ctrl+C signal( SIGINT, &::Signal_handler ); - SvFileStream aStream( rFileName, STREAM_STD_WRITE | STREAM_TRUNC ); + // -- Multithreading bug in SvStream ? Retry one time if creation fails + SvFileStream aStreamTest( rFileName, STREAM_STD_WRITE | STREAM_TRUNC ); + ByteString sFileName( rFileName , RTL_TEXTENCODING_ASCII_US ); + if( aStreamTest.IsOpen() ) aStreamTest.Close(); + //else printf("Prozess ID = %d -> Can't create file %s\nRetrying ....\n" , getpid() , sFileName.GetBuffer() ); + // -- -- + + SvFileStream aStream( rFileName, STREAM_STD_WRITE | STREAM_TRUNC ); if ( aStream.IsOpen()) { BOOL bReturn = Write( aStream ); aStream.Close(); - //signal(SIGINT,hOldHandler); signal(SIGINT,SIG_DFL); // Enable Ctrl+C return bReturn; + }else{ + printf("ERROR: Can't create file %s\n" , ByteString( rFileName , RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + signal(SIGINT,SIG_DFL); // Enable Ctrl+C + exit( -1 ); } signal(SIGINT,SIG_DFL); // Enable Ctrl+C } |