test-expandargv.c (writeout_test): Check result of fwrite.

* testsuite/test-expandargv.c (writeout_test): Check result of fwrite.

From-SVN: r177529
This commit is contained in:
Uros Bizjak 2011-08-06 19:38:04 +02:00
parent bc336d6308
commit bd82021880
2 changed files with 23 additions and 16 deletions

View File

@ -1,3 +1,7 @@
2011-08-06 Uros Bizjak <ubizjak@gmail.com>
* testsuite/test-expandargv.c (writeout_test): Check result of fwrite.
2011-08-01 Jason Merrill <jason@redhat.com>
PR c++/49932

View File

@ -189,7 +189,7 @@ writeout_test (int test, const char * test_data)
{
char filename[256];
FILE *fd;
size_t len;
size_t len, sys_fwrite;
char * parse;
/* Unique filename per test */
@ -208,7 +208,10 @@ writeout_test (int test, const char * test_data)
/* Run all possible replaces */
run_replaces (parse);
fwrite (parse, len, sizeof (char), fd);
sys_fwrite = fwrite (parse, sizeof (char), len, fd);
if (sys_fwrite != len)
fatal_error (__LINE__, "Failed to write to test file.", errno);
free (parse);
fclose (fd);
}