Kaydet (Commit) 44565f46 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Check exit code of spawned xpdfimport

Change-Id: I4bea1ebe5c9915ad5e3a4f8fecb516bc056d060d
üst e7118d20
......@@ -1059,7 +1059,7 @@ bool xpdf_ImportFromFile( const OUString& rURL,
oslFileHandle pOut = NULL;
oslFileHandle pErr = NULL;
oslSecurity pSecurity = osl_getCurrentSecurity ();
const oslProcessError eErr =
oslProcessError eErr =
osl_executeProcess_WithRedirectedIO(converterURL.pData,
args,
nArgs,
......@@ -1115,6 +1115,39 @@ bool xpdf_ImportFromFile( const OUString& rURL,
osl_closeFile(pOut);
if( pErr )
osl_closeFile(pErr);
eErr = osl_joinProcess(aProcess);
if (eErr == osl_Process_E_None)
{
oslProcessInfo info;
info.Size = sizeof info;
eErr = osl_getProcessInfo(aProcess, osl_Process_EXITCODE, &info);
if (eErr == osl_Process_E_None)
{
if (info.Code != 0)
{
SAL_WARN(
"sdext.pdfimport",
"getProcessInfo of " << converterURL
<< " failed with exit code " << info.Code);
bRet = false;
}
}
else
{
SAL_WARN(
"sdext.pdfimport",
"getProcessInfo of " << converterURL << " failed with "
<< +eErr);
bRet = false;
}
}
else
{
SAL_WARN(
"sdext.pdfimport",
"joinProcess of " << converterURL << " failed with " << +eErr);
bRet = false;
}
osl_freeProcessHandle(aProcess);
return bRet;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment