From ffa3a1c222c1a8b0296f97dfa3efb35108ac6d60 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Tue, 29 Mar 2016 15:35:58 -0700 Subject: uncrypt: fix call to close(). Bug: 27897229 Change-Id: Iab5e829af1676f7fcd8a4b00a194aa679ed4e372 --- uncrypt/uncrypt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp index e783b9e7a..ee4d616a7 100644 --- a/uncrypt/uncrypt.cpp +++ b/uncrypt/uncrypt.cpp @@ -372,7 +372,7 @@ static int produce_block_map(const char* path, const char* map_file, const char* ALOGE("failed to fsync \"%s\": %s", tmp_map_file.c_str(), strerror(errno)); return -1; } - if (close(mapfd.get() == -1)) { + if (close(mapfd.get()) == -1) { ALOGE("failed to close %s: %s", tmp_map_file.c_str(), strerror(errno)); return -1; } @@ -406,7 +406,7 @@ static int produce_block_map(const char* path, const char* map_file, const char* ALOGE("failed to fsync %s: %s", dir_name.c_str(), strerror(errno)); return -1; } - if (close(dfd.get() == -1)) { + if (close(dfd.get()) == -1) { ALOGE("failed to close %s: %s", dir_name.c_str(), strerror(errno)); return -1; } -- cgit v1.2.3