aboutsummaryrefslogtreecommitdiff
path: root/libiberty/testsuite/test-expandargv.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2011-08-06 18:40:27 +0000
committerDJ Delorie <dj@redhat.com>2011-08-06 18:40:27 +0000
commit6b6bd65aa5c27687304cd4add13ff1910ef349f7 (patch)
tree71292ff48728b04fd86c7f59eca7651c23be9847 /libiberty/testsuite/test-expandargv.c
parent2f7fb8e4c8d23a52f0ca284beeebc248aa63baaf (diff)
downloadgdb-6b6bd65aa5c27687304cd4add13ff1910ef349f7.zip
gdb-6b6bd65aa5c27687304cd4add13ff1910ef349f7.tar.gz
gdb-6b6bd65aa5c27687304cd4add13ff1910ef349f7.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/testsuite/test-expandargv.c')
-rw-r--r--libiberty/testsuite/test-expandargv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libiberty/testsuite/test-expandargv.c b/libiberty/testsuite/test-expandargv.c
index 57b96b3..dff20d4 100644
--- a/libiberty/testsuite/test-expandargv.c
+++ b/libiberty/testsuite/test-expandargv.c
@@ -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);
}