diff options
-rw-r--r-- | shell/source/unix/exec/shellexec.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index e1a923d4a8e4..6ecad95e6c81 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -258,12 +258,16 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar #else aBuffer.makeStringAndClear(); #endif - if ( 0 != pclose(popen(cmd.getStr(), "w")) ) + FILE *pLaunch = popen(cmd.getStr(), "w"); + if ( pLaunch != NULL ) { - int nerr = errno; - throw SystemShellExecuteException(OUString::createFromAscii( strerror( nerr ) ), - static_cast < XSystemShellExecute * > (this), nerr ); + if ( 0 == pclose( pLaunch ) ) + return; } + + int nerr = errno; + throw SystemShellExecuteException(OUString::createFromAscii( strerror( nerr ) ), + static_cast < XSystemShellExecute * > (this), nerr ); } // XServiceInfo |