OSDN Git Service

Do not send 0 byte string content.
authorDimitry Ivanov <dimitry@google.com>
Tue, 24 Jan 2017 20:39:33 +0000 (12:39 -0800)
committerDimitry Ivanov <dimitry@google.com>
Tue, 24 Jan 2017 22:19:03 +0000 (14:19 -0800)
commitcafd3553751dfb524316884fb213eb80c75a26a2
tree9accfb894608a6c131aa011490cce799f0160abe
parent16b2a4de143a026b8d467b7d242126adcf67242b
Do not send 0 byte string content.

Trying to send even 0 bytes to closed socket leads to
broken pipe error. Sometimes property service is just
quick enough and closes the socket between send(valuelen)
and send(value) in the case where valuelen is 0.

Bug: http://b/34670529
Test: adb reboot 20 times and make sure phone service did not fail
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I96f90ca6fe1790614e7efd3015bffed1ef1e9040
libc/bionic/system_properties.cpp
tests/system_properties_test2.cpp