netd: all: use system() instead of logwrap() for now.
The logwrapper uses a blocking read() which does not always
correctly detect when the child process at the other end is gone.
This is a quick workaround for http://b/5144246
A cleaner logwrapper parent() will follow.
Add support for BandwidthController() to use either system() or
logwrap(). It looks at "persist.bandwidth.uselogwrap" to be 0 or 1.
Change-Id: I2d17732214f1a7fef6838eee05d827695b707ab0
Signed-off-by: JP Abgrall <jpa@google.com>
diff --git a/BandwidthController.h b/BandwidthController.h
index 70a4e1e..3e45d40 100644
--- a/BandwidthController.h
+++ b/BandwidthController.h
@@ -93,6 +93,10 @@
int setCostlyAlert(const char *costName, int64_t bytes, int64_t *alertBytes);
int removeCostlyAlert(const char *costName, int64_t *alertBytes);
+ /*
+ * When false, it will directly use system() instead of logwrap()
+ */
+ static bool useLogwrapCall;
private:
static const char *cleanupCommands[];