summaryrefslogtreecommitdiff
path: root/benchmarks/stdio_benchmark.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-05-13 13:18:04 -0700
committerElliott Hughes <enh@google.com>2015-05-13 13:18:04 -0700
commitc217373bd69c501e5ad30d72df1893ab81c7fd66 (patch)
treebe998650c41a2bf0c46ec626e2e2efafe5fc5987 /benchmarks/stdio_benchmark.cpp
parentfe77d2d0036306eec978eccf7b4db81fa424a2f3 (diff)
Fix unused result errors in bionic.
This lets us use _FORTIFY_SOURCE=2 on the host. Change-Id: I69f5ff9834bfd595aae6584104bee10c4d8a5eeb
Diffstat (limited to 'benchmarks/stdio_benchmark.cpp')
-rw-r--r--benchmarks/stdio_benchmark.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/benchmarks/stdio_benchmark.cpp b/benchmarks/stdio_benchmark.cpp
index 342e56154..69e01a996 100644
--- a/benchmarks/stdio_benchmark.cpp
+++ b/benchmarks/stdio_benchmark.cpp
@@ -16,6 +16,7 @@
#include <stdio.h>
#include <stdio_ext.h>
+#include <stdlib.h>
#include <benchmark/Benchmark.h>
@@ -73,7 +74,7 @@ static void FopenFgetsFclose(int iters, bool no_locking) {
for (int i = 0; i < iters; ++i) {
FILE* fp = fopen("/proc/version", "re");
if (no_locking) __fsetlocking(fp, FSETLOCKING_BYCALLER);
- fgets(buf, sizeof(buf), fp);
+ if (fgets(buf, sizeof(buf), fp) == nullptr) abort();
fclose(fp);
}
}