From 3c8d74eb3f853e3fa00afae284ae391caeb143fb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 13 Jan 2014 14:25:20 +0100 Subject: Handle osl_createThread failure Change-Id: I58144461d3941359f8ea6c2bd547486b2c8ae81a --- sal/osl/unx/process.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sal/osl/unx/process.cxx') diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index ee6346899840..24d0be6af678 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -685,7 +685,10 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, hThread = osl_createThread(ChildStatusProc, &Data); - osl_waitCondition(Data.m_started, NULL); + if (hThread != 0) + { + osl_waitCondition(Data.m_started, NULL); + } osl_destroyCondition(Data.m_started); for (i = 0; Data.m_pszArgs[i] != NULL; i++) @@ -703,12 +706,14 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, if (Data.m_pProcImpl->m_pid != 0) { + assert(hThread != 0); + *pProcess = Data.m_pProcImpl; if (Options & osl_Process_WAIT) osl_joinProcess(*pProcess); - return osl_Process_E_None; + return osl_Process_E_None; } osl_destroyCondition(Data.m_pProcImpl->m_terminated); -- cgit