summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/log/uio.h6
-rw-r--r--liblog/fake_log_device.c10
-rw-r--r--liblog/uio.c10
3 files changed, 13 insertions, 13 deletions
diff --git a/include/log/uio.h b/include/log/uio.h
index 01a74d26f..a71f515e0 100644
--- a/include/log/uio.h
+++ b/include/log/uio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007 The Android Open Source Project 2 * Copyright (C) 2007-2014 The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@ extern "C" {
31#include <stddef.h> 31#include <stddef.h>
32 32
33struct iovec { 33struct iovec {
34 const void* iov_base; 34 void* iov_base;
35 size_t iov_len; 35 size_t iov_len;
36}; 36};
37 37
38extern int readv( int fd, struct iovec* vecs, int count ); 38extern int readv( int fd, struct iovec* vecs, int count );
diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c
index 528361986..8d3106056 100644
--- a/liblog/fake_log_device.c
+++ b/liblog/fake_log_device.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2008 The Android Open Source Project 2 * Copyright (C) 2008-2014 The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -320,11 +320,11 @@ static const char* getPriorityString(int priority)
320 * Make up something to replace it. 320 * Make up something to replace it.
321 */ 321 */
322static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) { 322static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) {
323 int result = 0; 323 ssize_t result = 0;
324 struct iovec* end = iov + iovcnt; 324 const struct iovec* end = iov + iovcnt;
325 for (; iov < end; iov++) { 325 for (; iov < end; iov++) {
326 int w = write(fd, iov->iov_base, iov->iov_len); 326 ssize_t w = write(fd, iov->iov_base, iov->iov_len);
327 if (w != iov->iov_len) { 327 if (w != (ssize_t) iov->iov_len) {
328 if (w < 0) 328 if (w < 0)
329 return w; 329 return w;
330 return result + w; 330 return result + w;
diff --git a/liblog/uio.c b/liblog/uio.c
index cfa4cb122..24a65075f 100644
--- a/liblog/uio.c
+++ b/liblog/uio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007 The Android Open Source Project 2 * Copyright (C) 2007-2014 The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@ int readv( int fd, struct iovec* vecs, int count )
24 int total = 0; 24 int total = 0;
25 25
26 for ( ; count > 0; count--, vecs++ ) { 26 for ( ; count > 0; count--, vecs++ ) {
27 const char* buf = vecs->iov_base; 27 char* buf = vecs->iov_base;
28 int len = vecs->iov_len; 28 int len = vecs->iov_len;
29 29
30 while (len > 0) { 30 while (len > 0) {
31 int ret = read( fd, buf, len ); 31 int ret = read( fd, buf, len );
@@ -51,8 +51,8 @@ int writev( int fd, const struct iovec* vecs, int count )
51 int total = 0; 51 int total = 0;
52 52
53 for ( ; count > 0; count--, vecs++ ) { 53 for ( ; count > 0; count--, vecs++ ) {
54 const char* buf = (const char*)vecs->iov_base; 54 const char* buf = vecs->iov_base;
55 int len = (int)vecs->iov_len; 55 int len = vecs->iov_len;
56 56
57 while (len > 0) { 57 while (len > 0) {
58 int ret = write( fd, buf, len ); 58 int ret = write( fd, buf, len );