summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2015-04-24 20:25:50 -0700
committerNick Kralevich <nnk@google.com>2015-04-24 20:27:06 -0700
commit9709a1f04c1b6d44d75d504c3e200be256e52e50 (patch)
treec9492f6241a52d854f24cd6c3681750538934016
parente60077e62a441dbcc132b2abb35d998ab48d261c (diff)
downloadframeworks_base-9709a1f04c1b6d44d75d504c3e200be256e52e50.zip
frameworks_base-9709a1f04c1b6d44d75d504c3e200be256e52e50.tar.gz
frameworks_base-9709a1f04c1b6d44d75d504c3e200be256e52e50.tar.bz2
fix compiler error under FORTIFY_SOURCE=2
frameworks/base/libs/androidfw/ObbFile.cpp:340:5: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] ftruncate(fd, mFooterStart); ^~~~~~~~~ ~~~~~~~~~~~~~~~~ 1 error generated. amake: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libandroidfw_intermediates/ObbFile.o] Error 1 Change-Id: I7080d64e7a830a10b41c1ebf33c60d32b7c8356e
-rw-r--r--libs/androidfw/ObbFile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/androidfw/ObbFile.cpp b/libs/androidfw/ObbFile.cpp
index 195fa9a..95332a3 100644
--- a/libs/androidfw/ObbFile.cpp
+++ b/libs/androidfw/ObbFile.cpp
@@ -337,7 +337,9 @@ bool ObbFile::removeFrom(int fd)
return false;
}
- ftruncate(fd, mFooterStart);
+ if (ftruncate(fd, mFooterStart) == -1) {
+ return false;
+ }
return true;
}