From ff9fc451496ac0503809e83638bf470e763fe250 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 13 Feb 2015 21:04:34 -0800 Subject: [PATCH] Add POSIX version of error message in plSecureStream::IRead --- Sources/Plasma/CoreLib/HeadSpin.cpp | 11 +++++------ Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Sources/Plasma/CoreLib/HeadSpin.cpp b/Sources/Plasma/CoreLib/HeadSpin.cpp index db933b3e..a9919dea 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.cpp +++ b/Sources/Plasma/CoreLib/HeadSpin.cpp @@ -93,15 +93,14 @@ void hsDebugMessage (const char* message, long val) gHSDebugProc(&s[1]); else #if HS_BUILD_FOR_WIN32 - { OutputDebugString(&s[1]); + { + OutputDebugString(&s[1]); OutputDebugString("\n"); } -#elif HS_BUILD_FOR_UNIX - { fprintf(stderr, "%s\n", &s[1]); -// hsThrow(&s[1]); - } #else - hsThrow(&s[1]); + { + fprintf(stderr, "%s\n", &s[1]); + } #endif } #endif diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index d65a6074..25d47a8c 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsSTLStream.h" #if !HS_BUILD_FOR_WIN32 +#include #define INVALID_HANDLE_VALUE 0 #endif @@ -325,9 +326,10 @@ uint32_t plSecureStream::IRead(uint32_t bytes, void* buffer) } else { - // TODO: errno equivalent for *nix #if HS_BUILD_FOR_WIN32 hsDebugMessage("Error on Windows read", GetLastError()); +#else + hsDebugMessage("Error on POSIX read", errno); #endif } }