Ensure all commands read on dnsmasq's stdin are processed

As described in issue 30016, android dnsmasq daemon is misconfigured after initializing tethering.
The reason is that two commands are present on dnsmasq stdin when check_android_listeners is called:
update_dns:8.8.8.8:8.8.4.4\0update_dns:192.x.y.z (notice the \0 between the 2 commands).
check_android_listeners assumes there is a single NUL terminated string and skip the second one.
This patch ensure that every commands are processed by checking wether or not all the characters on stdin have been consumed and loop if needed.
Also fixes style issues.

Change-Id: I6d98233964559b8dcc1253aec105a240e1065c94
Signed-off-by: Pierre Crépieux <pierre.crepieux@orange.com>
1 file changed