From eb93bfbee8da26b1df81ffe8687210855a82f35b Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 7 Aug 2011 17:11:48 +0200 Subject: [PATCH] test-expandargv.c (writeout_test): Check result of fwrite. * testsuite/test-expandargv.c (writeout_test): Check result of fwrite. From-SVN: r177547 --- libiberty/ChangeLog | 10 +++++++--- libiberty/testsuite/test-expandargv.c | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 413319b289aa..6742d92c9ee7 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2011-08-06 Uros Bizjak + + * testsuite/test-expandargv.c (writeout_test): Check result of fwrite. + 2011-04-28 Release Manager * GCC 4.5.3 released. @@ -284,7 +288,7 @@ 2009-04-29 Julian Brown - * pex-win32.c (pex_win32_pipe): Add _O_NOINHERIT. + * pex-win32.c (pex_win32_pipe): Add _O_NOINHERIT. (pex_win32_exec_child): Ensure each process has only one handle open on pipe endpoints. Close standard input after creating child for symmetry with standard output/standard error. @@ -302,7 +306,7 @@ section, so that the native build does detect them at configure time. * configure: Regenerated. - + 2009-04-13 Ozkan Sezer PR target/39397 @@ -402,7 +406,7 @@ 2008-10-08 David Edelsohn * xstrdup.c: Include after "config.h" - + 2008-10-07 Jan Kratochvil * configure.ac: Call AC_SYS_LARGEFILE. diff --git a/libiberty/testsuite/test-expandargv.c b/libiberty/testsuite/test-expandargv.c index c16a0322a6c4..dc44a1750e8a 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); } -- 2.47.2