summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBo Huang2014-09-29 01:54:02 -0500
committerElliott Hughes2014-11-10 17:45:16 -0600
commit4df4dfedf6beef891d05d4e80704f5f4a594a885 (patch)
treec2650b22f4d2d3f9a9ae7897ae67fe66b02af2ef /libsysutils
parentae52248fa7ab12e1c3458aede101f143b1c76ead (diff)
downloadplatform-system-core-4df4dfedf6beef891d05d4e80704f5f4a594a885.tar.gz
platform-system-core-4df4dfedf6beef891d05d4e80704f5f4a594a885.tar.xz
platform-system-core-4df4dfedf6beef891d05d4e80704f5f4a594a885.zip
When new error happend,then errno should be updated accordingly.
Otherwise, need to keep previous errno. Reproduced steps: pre-condition: DUT support external SDcard or Usb mass storage; 1. Insert blank(no partition) SDcard or UMS to DUT; Expected result: Should prompt user with storage error. Test result: There is no notification for error. Error log: 01-01 01:06:49.239 I/fsck_msdos( 200): fsck_msdos terminated by exit(8) 01-01 01:06:49.239 E/Vold ( 200): /dev/block/vold/179:16 failed FS checks (I/O error) 01-01 01:06:49.239 D/Vold ( 200): Volume sdcard1 state changing 3 (Checking) -> 1 (Idle-Unmounted) 01-01 01:06:49.239 W/Vold ( 200): Returning OperationFailed - no handler for errno 0) Root cause analysis: 1.Volume::setState will call senBroadcase to send out state notification; 2.Finally, SocketClient::sendDataLockedv was called to sent message. In sendDataLockedv funtion, when current == iovcnt, e is 0 by default. So Vold get incorrect errno. Change-Id: Icb32a4193f02f22b5e3feaba177bc278f8f1f41b Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Diffstat (limited to 'libsysutils')
-rw-r--r--libsysutils/src/SocketClient.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index d3ce8f5a8..4ab06b4af 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -220,7 +220,8 @@ int SocketClient::sendDataLockedv(struct iovec *iov, int iovcnt) {
220 220
221 sigaction(SIGPIPE, &old_action, &new_action); 221 sigaction(SIGPIPE, &old_action, &new_action);
222 222
223 errno = e; 223 if ( e != 0 )
224 errno = e;
224 return ret; 225 return ret;
225} 226}
226 227