From b7a0166b0093cf35b8d808f7bfb79e94222805df Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Fri, 19 Feb 2016 13:08:59 -0800 Subject: liblog: deal with warning messages (cherry pick from commit b525884edb1f8a80a8fc6cad58c69bdacc5bdb90) - Fix bug in fake_log_devices when it can not allocate memory failing to use the full on-stack buffer as backup. - remove superfluous code. Bug: 27265662 Change-Id: I97b6cca5f4ce8ecad9beb3a08353de596d6a4ad1 --- liblog/fake_log_device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'liblog/fake_log_device.c') diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c index cb80ee63c..f4e071b8c 100644 --- a/liblog/fake_log_device.c +++ b/liblog/fake_log_device.c @@ -465,13 +465,13 @@ static void showLog(LogState *state, if (numLines > MAX_LINES) numLines = MAX_LINES; - numVecs = numLines*3; // 3 iovecs per line. + numVecs = numLines * 3; // 3 iovecs per line. if (numVecs > INLINE_VECS) { vec = (struct iovec*)malloc(sizeof(struct iovec)*numVecs); if (vec == NULL) { msg = "LOG: write failed, no memory"; - numVecs = 3; - numLines = 1; + numVecs = INLINE_VECS; + numLines = numVecs / 3; vec = stackVec; } } -- cgit v1.2.3-54-g00ecf