Check result of fread.

This commit is contained in:
Victor Zverovich 2014-08-29 06:57:26 -07:00
parent e62354a190
commit ab35af53c5

View File

@ -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;
}