Use system/popen on Syllable since msystem/mpopen fail there; root cause is still TBD.

This commit is contained in:
Brian Cox 2018-02-24 22:50:25 -08:00
parent ffe929240d
commit 0f236fabf4
3 changed files with 9 additions and 4 deletions

View File

@ -320,7 +320,10 @@
#define WCHAR_IS_16_BITS IS_WIN32
#define WCHAR_IS_32_BITS IS_UNIX
#define WCHAR_REP_IS_UCS2 IS_WIN32
#define USES_MPOPEN IS_UNIX
// msystem+mpopen fail on Syllable, so use the libc equivalents until we figure out why.
// TODO: Figure out why.
#define USES_MPOPEN (IS_UNIX && !IS_SYLLABLE)
#define USES_MSYSTEM (IS_UNIX && !IS_SYLLABLE)
#define SUPPORTS_WCHART IS_WIN32 // TODO: Remove after getting new ver of KAI
#define USES_GLIBC ((COMP == COMP_KAI_GLIBC) || HAVE_GCC)
#define SUPPORTS_MEMBER_TEMPLATES ( ! IS_SUNPRO )

View File

@ -155,9 +155,7 @@ void cPipedMailMessage::SendInit()// throw( eMailMessageError )
strHeader += cStringUtil::StrToTstr( cMailMessage::Create822Header() );
#if !USES_MPOPEN
// Call _wpopen under NT
// TODO access the risk of _wpopen under NT
mpFile = _wpopen(mstrSendMailExePath.c_str(), _T("w"));
mpFile = popen(mstrSendMailExePath.c_str(), _T("w"));
#else
// call mpopen, our safe version popen
mpFile = mpopen( (char*) mstrSendMailExePath.c_str(), _T("w") );

View File

@ -696,6 +696,7 @@ bool cTextReportViewer::LaunchEditorOnFile( const TSTRING& strFilename, const TS
// make sure we can read from this file
cFileUtil::TestFileReadable( strFilename );
#if USES_MSYSTEM
// editor is going to need terminal type, so tell msystem to include
// it in environment when it makes its system call.
le_set("TERM");
@ -707,6 +708,9 @@ bool cTextReportViewer::LaunchEditorOnFile( const TSTRING& strFilename, const TS
le_unset("HOME");
le_unset("DISPLAY");
le_unset("TERM");
#else
int systemRet = system( (char*) ( ( editor+ _T(' ') + strFilename ).c_str() ) );
#endif
if( 0 == systemRet )
{