diff --git a/src/core/platform.h b/src/core/platform.h index 8085044..6b2cd7c 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -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 ) diff --git a/src/tripwire/pipedmailmessage.cpp b/src/tripwire/pipedmailmessage.cpp index dd375bc..d1b58ef 100644 --- a/src/tripwire/pipedmailmessage.cpp +++ b/src/tripwire/pipedmailmessage.cpp @@ -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") ); diff --git a/src/tw/textreportviewer.cpp b/src/tw/textreportviewer.cpp index a73d237..6a75f76 100644 --- a/src/tw/textreportviewer.cpp +++ b/src/tw/textreportviewer.cpp @@ -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 ) {