From 16159170b600c7f19f53a812beb6be01e4cfb1b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Jan 2008 15:01:21 +0100 Subject: [PATCH] Bug#30366 NDB fails to start on OS X, PPC, 64 bit - The errno variable should only be used when the previous socket write failed, it should be regarded as undefined at other times OutputStream.cpp: Only use "errno" after the attempt to write to the socket has failed storage/ndb/src/common/util/OutputStream.cpp: Only use "errno" after the attempt to write to the socket has failed --- storage/ndb/src/common/util/OutputStream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/common/util/OutputStream.cpp b/storage/ndb/src/common/util/OutputStream.cpp index 0943e47e33f..cd619380e5a 100644 --- a/storage/ndb/src/common/util/OutputStream.cpp +++ b/storage/ndb/src/common/util/OutputStream.cpp @@ -62,7 +62,7 @@ SocketOutputStream::print(const char * fmt, ...){ if(ret >= 0) m_timeout_remain-=time; - if(errno==ETIMEDOUT || m_timeout_remain<=0) + if((ret < 0 && errno==ETIMEDOUT) || m_timeout_remain<=0) { m_timedout= true; ret= -1; @@ -84,7 +84,7 @@ SocketOutputStream::println(const char * fmt, ...){ if(ret >= 0) m_timeout_remain-=time; - if (errno==ETIMEDOUT || m_timeout_remain<=0) + if ((ret < 0 && errno==ETIMEDOUT) || m_timeout_remain<=0) { m_timedout= true; ret= -1;