Merge "identity/Util: Fix file write check" am: 61e8fb9442 am: 2f5ce9939d am: f9f02fde96
Change-Id: I53d2f39d0792c53cdbbad59b05457218a877d0b8
diff --git a/identity/Util.cpp b/identity/Util.cpp
index c397913..70e7105 100644
--- a/identity/Util.cpp
+++ b/identity/Util.cpp
@@ -60,7 +60,7 @@
uint8_t* p = data.data();
size_t remaining = data.size();
while (remaining > 0) {
- size_t numRead = TEMP_FAILURE_RETRY(read(fd, p, remaining));
+ ssize_t numRead = TEMP_FAILURE_RETRY(read(fd, p, remaining));
if (numRead <= 0) {
PLOG(ERROR) << "Failed reading from '" << path << "'";
close(fd);
@@ -94,7 +94,7 @@
const uint8_t* p = data.data();
size_t remaining = data.size();
while (remaining > 0) {
- size_t numWritten = TEMP_FAILURE_RETRY(write(fd, p, remaining));
+ ssize_t numWritten = TEMP_FAILURE_RETRY(write(fd, p, remaining));
if (numWritten <= 0) {
PLOG(ERROR) << "Failed writing into temp file for '" << path << "'";
close(fd);