summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-02-19 15:08:59 -0600
committerMark Salyzyn2016-02-22 17:46:22 -0600
commitb7a0166b0093cf35b8d808f7bfb79e94222805df (patch)
tree602163a75bb847d001ca74a5171a49000c2df2ba /liblog/fake_log_device.c
parenta9061ece0519755808e84909ad3747462c1fe666 (diff)
downloadplatform-system-core-b7a0166b0093cf35b8d808f7bfb79e94222805df.tar.gz
platform-system-core-b7a0166b0093cf35b8d808f7bfb79e94222805df.tar.xz
platform-system-core-b7a0166b0093cf35b8d808f7bfb79e94222805df.zip
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
Diffstat (limited to 'liblog/fake_log_device.c')
-rw-r--r--liblog/fake_log_device.c6
1 files changed, 3 insertions, 3 deletions
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,
465 if (numLines > MAX_LINES) 465 if (numLines > MAX_LINES)
466 numLines = MAX_LINES; 466 numLines = MAX_LINES;
467 467
468 numVecs = numLines*3; // 3 iovecs per line. 468 numVecs = numLines * 3; // 3 iovecs per line.
469 if (numVecs > INLINE_VECS) { 469 if (numVecs > INLINE_VECS) {
470 vec = (struct iovec*)malloc(sizeof(struct iovec)*numVecs); 470 vec = (struct iovec*)malloc(sizeof(struct iovec)*numVecs);
471 if (vec == NULL) { 471 if (vec == NULL) {
472 msg = "LOG: write failed, no memory"; 472 msg = "LOG: write failed, no memory";
473 numVecs = 3; 473 numVecs = INLINE_VECS;
474 numLines = 1; 474 numLines = numVecs / 3;
475 vec = stackVec; 475 vec = stackVec;
476 } 476 }
477 } 477 }