am af2cd21d: Merge "When new error happend,then errno should be updated accordingly. Otherwise, need to keep previous errno."
* commit 'af2cd21d00f16f4915a40004bdbdc2603e958f5a':
When new error happend,then errno should be updated accordingly. Otherwise, need to keep previous errno.
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index d3ce8f5..4ab06b4 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -220,7 +220,8 @@
sigaction(SIGPIPE, &old_action, &new_action);
- errno = e;
+ if ( e != 0 )
+ errno = e;
return ret;
}