From ab35af53c52244750c3462c1de28a2d9074ef32d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 29 Aug 2014 06:57:26 -0700 Subject: [PATCH] Check result of fread. --- test/posix-test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/posix-test.cc b/test/posix-test.cc index b2e78e1a..af9f06e8 100644 --- a/test/posix-test.cc +++ b/test/posix-test.cc @@ -308,7 +308,8 @@ TEST(BufferedFileTest, OpenRetry) { fopen, "cannot open file test"); #ifndef _WIN32 char c = 0; - fread(&c, 1, 1, f->get()); + if (fread(&c, 1, 1, f->get()) < 1) + throw fmt::SystemError(errno, "fread failed"); #endif delete f; }