Merge "emulator opengl: more few fixups needed for the system to load."
diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.cpp b/tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.cpp
index e774c62..f144a9f 100644
--- a/tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.cpp
+++ b/tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.cpp
@@ -148,12 +148,11 @@
 {
     if (!valid()) return NULL;
     if (!buf) {
-      ERR("TcpStream::readFully failed, buf=NULL");
       return NULL;  // do not allow NULL buf in that implementation
     }
     size_t res = len;
     while (res > 0) {
-        ssize_t stat = ::recv(m_sock, (char *)(buf) + len - res, len, 0);
+        ssize_t stat = ::recv(m_sock, (char *)(buf) + len - res, res, 0);
         if (stat == 0) {
             // client shutdown;
             return NULL;
@@ -161,7 +160,6 @@
             if (errno == EINTR) {
                 continue;
             } else {
-                ERR("TcpStream::readFully failed (buf 0x%x): %s\n", buf, strerror(errno));
                 return NULL;
             }
         } else {
@@ -175,7 +173,6 @@
 {
     if (!valid()) return NULL;
     if (!buf) {
-      ERR("TcpStream::read failed, buf=NULL");
       return NULL;  // do not allow NULL buf in that implementation
     }
 
diff --git a/tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.cpp b/tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.cpp
index 65107e3..e8e6ab7 100644
--- a/tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.cpp
+++ b/tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.cpp
@@ -36,6 +36,10 @@
 #endif
 
     if (lib->m_lib == NULL) {
+        printf("Failed to load %s\n", p_libName);
+#ifndef _WIN32
+        printf("error %s\n", dlerror()); //only on linux
+#endif
         delete lib;
         return NULL;
     }
diff --git a/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp b/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp
index 744acf4..898cbd7 100644
--- a/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp
+++ b/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp
@@ -26,7 +26,7 @@
 int main(int argc, char *argv[])
 #endif
 {
-    int portNum = 4141;
+    int portNum = 22468;
     int winWidth = 320;
     int winHeight = 480;
     FBNativeWindowType windowId = NULL;
diff --git a/tools/emulator/opengl/tests/gles_android_wrapper/Android.mk b/tools/emulator/opengl/tests/gles_android_wrapper/Android.mk
index f614798..ed98543 100644
--- a/tools/emulator/opengl/tests/gles_android_wrapper/Android.mk
+++ b/tools/emulator/opengl/tests/gles_android_wrapper/Android.mk
@@ -127,10 +127,11 @@
 	libcutils \
 	libGLESv1_enc \
 	libGLESv2_enc \
-	libut_rendercontrol_enc \
-    libOpenglSystemCommon
+	libOpenglSystemCommon \
+	libut_rendercontrol_enc
 
-LOCAL_STATIC_LIBRARIES := libOpenglCodecCommon libqemu
+LOCAL_STATIC_LIBRARIES := libOpenglCodecCommon \
+						  libqemu
 
 include $(BUILD_SHARED_LIBRARY)