Loading include/log/uio.h +3 −3 Original line number Original line Diff line number Diff line /* /* * Copyright (C) 2007 The Android Open Source Project * Copyright (C) 2007-2014 The Android Open Source Project * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading Loading @@ -31,7 +31,7 @@ extern "C" { #include <stddef.h> #include <stddef.h> struct iovec { struct iovec { const void* iov_base; void* iov_base; size_t iov_len; size_t iov_len; }; }; Loading liblog/fake_log_device.c +5 −5 Original line number Original line Diff line number Diff line /* /* * Copyright (C) 2008 The Android Open Source Project * Copyright (C) 2008-2014 The Android Open Source Project * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading Loading @@ -322,11 +322,11 @@ static const char* getPriorityString(int priority) * Make up something to replace it. * Make up something to replace it. */ */ static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) { static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) { int result = 0; ssize_t result = 0; struct iovec* end = iov + iovcnt; const struct iovec* end = iov + iovcnt; for (; iov < end; iov++) { for (; iov < end; iov++) { int w = write(fd, iov->iov_base, iov->iov_len); ssize_t w = write(fd, iov->iov_base, iov->iov_len); if (w != iov->iov_len) { if (w != (ssize_t) iov->iov_len) { if (w < 0) if (w < 0) return w; return w; return result + w; return result + w; Loading liblog/uio.c +5 −5 Original line number Original line Diff line number Diff line /* /* * Copyright (C) 2007 The Android Open Source Project * Copyright (C) 2007-2014 The Android Open Source Project * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading @@ -24,7 +24,7 @@ int readv( int fd, struct iovec* vecs, int count ) int total = 0; int total = 0; for ( ; count > 0; count--, vecs++ ) { for ( ; count > 0; count--, vecs++ ) { const char* buf = vecs->iov_base; char* buf = vecs->iov_base; int len = vecs->iov_len; int len = vecs->iov_len; while (len > 0) { while (len > 0) { Loading @@ -51,8 +51,8 @@ int writev( int fd, const struct iovec* vecs, int count ) int total = 0; int total = 0; for ( ; count > 0; count--, vecs++ ) { for ( ; count > 0; count--, vecs++ ) { const char* buf = (const char*)vecs->iov_base; const char* buf = vecs->iov_base; int len = (int)vecs->iov_len; int len = vecs->iov_len; while (len > 0) { while (len > 0) { int ret = write( fd, buf, len ); int ret = write( fd, buf, len ); Loading Loading
include/log/uio.h +3 −3 Original line number Original line Diff line number Diff line /* /* * Copyright (C) 2007 The Android Open Source Project * Copyright (C) 2007-2014 The Android Open Source Project * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading Loading @@ -31,7 +31,7 @@ extern "C" { #include <stddef.h> #include <stddef.h> struct iovec { struct iovec { const void* iov_base; void* iov_base; size_t iov_len; size_t iov_len; }; }; Loading
liblog/fake_log_device.c +5 −5 Original line number Original line Diff line number Diff line /* /* * Copyright (C) 2008 The Android Open Source Project * Copyright (C) 2008-2014 The Android Open Source Project * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading Loading @@ -322,11 +322,11 @@ static const char* getPriorityString(int priority) * Make up something to replace it. * Make up something to replace it. */ */ static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) { static ssize_t fake_writev(int fd, const struct iovec *iov, int iovcnt) { int result = 0; ssize_t result = 0; struct iovec* end = iov + iovcnt; const struct iovec* end = iov + iovcnt; for (; iov < end; iov++) { for (; iov < end; iov++) { int w = write(fd, iov->iov_base, iov->iov_len); ssize_t w = write(fd, iov->iov_base, iov->iov_len); if (w != iov->iov_len) { if (w != (ssize_t) iov->iov_len) { if (w < 0) if (w < 0) return w; return w; return result + w; return result + w; Loading
liblog/uio.c +5 −5 Original line number Original line Diff line number Diff line /* /* * Copyright (C) 2007 The Android Open Source Project * Copyright (C) 2007-2014 The Android Open Source Project * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading @@ -24,7 +24,7 @@ int readv( int fd, struct iovec* vecs, int count ) int total = 0; int total = 0; for ( ; count > 0; count--, vecs++ ) { for ( ; count > 0; count--, vecs++ ) { const char* buf = vecs->iov_base; char* buf = vecs->iov_base; int len = vecs->iov_len; int len = vecs->iov_len; while (len > 0) { while (len > 0) { Loading @@ -51,8 +51,8 @@ int writev( int fd, const struct iovec* vecs, int count ) int total = 0; int total = 0; for ( ; count > 0; count--, vecs++ ) { for ( ; count > 0; count--, vecs++ ) { const char* buf = (const char*)vecs->iov_base; const char* buf = vecs->iov_base; int len = (int)vecs->iov_len; int len = vecs->iov_len; while (len > 0) { while (len > 0) { int ret = write( fd, buf, len ); int ret = write( fd, buf, len ); Loading