]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sckstrm.cpp
chmod is not available in VisualAge
[wxWidgets.git] / src / common / sckstrm.cpp
index ebb6441a11398cef41d69f8e35c9bfc27aebd889..1e1417c416d411155459f7b0890279031ba968c5 100644 (file)
@@ -48,10 +48,10 @@ size_t wxSocketOutputStream::OnSysWrite(const void *buffer, size_t size)
 
   ret = m_o_socket->Write((const char *)buffer, size).LastCount();
 
-  if (ret > 0)
-    m_lasterror = wxStream_NOERROR;
+  if (m_o_socket->Error())
+    m_lasterror = wxStream_WRITE_ERR;
   else
-    m_lasterror = wxStream_READ_ERR;
+    m_lasterror = wxStream_NOERROR;
 
   return ret;
 
@@ -76,10 +76,10 @@ size_t wxSocketInputStream::OnSysRead(void *buffer, size_t size)
 
   ret = m_i_socket->Read((char *)buffer, size).LastCount();
 
-  if (ret > 0)
-    m_lasterror = wxStream_NOERROR;
-  else
+  if (m_i_socket->Error())
     m_lasterror = wxStream_READ_ERR;
+  else
+    m_lasterror = wxStream_NOERROR;
 
   return ret;
 }