Commit bd820218 by Uros Bizjak

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

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

From-SVN: r177529
parent bc336d63
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> 2011-08-01 Jason Merrill <jason@redhat.com>
PR c++/49932 PR c++/49932
......
...@@ -189,7 +189,7 @@ writeout_test (int test, const char * test_data) ...@@ -189,7 +189,7 @@ writeout_test (int test, const char * test_data)
{ {
char filename[256]; char filename[256];
FILE *fd; FILE *fd;
size_t len; size_t len, sys_fwrite;
char * parse; char * parse;
/* Unique filename per test */ /* Unique filename per test */
...@@ -208,7 +208,10 @@ writeout_test (int test, const char * test_data) ...@@ -208,7 +208,10 @@ writeout_test (int test, const char * test_data)
/* Run all possible replaces */ /* Run all possible replaces */
run_replaces (parse); 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); free (parse);
fclose (fd); fclose (fd);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment