From bf892517fcada0563d9a7978135f8898817c5792 Mon Sep 17 00:00:00 2001 From: Jason Tang Date: Fri, 16 Mar 2012 20:42:19 -0400 Subject: [PATCH] Resolves 37531: Appends PID to named pipe path. --- desktop/source/app/officeipcthread.cxx | 6 ++++-- desktop/source/deployment/misc/dp_misc.cxx | 3 +++ desktop/unx/source/start.c | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 4306a67..4c1fff8 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -493,7 +493,9 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() if ( aUserInstallPathHashCode.isEmpty() ) return IPC_STATUS_BOOTSTRAP_ERROR; // Something completely broken, we cannot create a valid hash code! - pThread->maPipeIdent = pThread->maPipeIdent + aUserInstallPathHashCode; + OUString myPid = OUString::valueOf((sal_Int64)getpid()); + + pThread->maPipeIdent = pThread->maPipeIdent + aUserInstallPathHashCode + OUString( RTL_CONSTASCII_USTRINGPARAM( "_PID_" ) ) + myPid; PipeMode nPipeMode = PIPEMODE_DONTKNOW; do @@ -519,7 +521,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() // Wait for second office to be ready TimeValue aTimeValue; aTimeValue.Seconds = 0; - aTimeValue.Nanosec = 10000000; // 10ms + aTimeValue.Nanosec = 100000000; // 10ms salhelper::Thread::wait( aTimeValue ); } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index d88faea..9b7b488 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -128,6 +128,9 @@ const OUString OfficePipeId::operator () () for ( sal_uInt32 i = 0; i < md5_key_len; ++i ) { buf.append( static_cast(md5_buf[ i ]), 0x10 ); } + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("_PID_") ); + OUString myPid = OUString::valueOf((sal_Int64)getpid()); + buf.append(myPid); return buf.makeStringAndClear(); } diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index f2c6e58..d33040b 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -352,6 +352,13 @@ get_pipe_path( rtl_uString *pAppPath ) rtl_uString_newConcat( &pResult, pResult, pMd5hash ); + rtl_uString_newFromAscii( &pTmp, "_PID_" ); + rtl_uString_newConcat( &pResult, pResult, pTmp ); + + rtl_ustr_valueOfInt64( pUnicode, (long)getpid(), 10 ); + rtl_uString_newFromStr( &pTmp, pUnicode ); + rtl_uString_newConcat( &pResult, pResult, pTmp ); + ustr_debug( "result", pResult ); /* cleanup */ -- 1.7.7.6