]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
test-expandargv.c (writeout_test): Check result of fwrite.
authorUros Bizjak <uros@gcc.gnu.org>
Sun, 7 Aug 2011 15:11:48 +0000 (17:11 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 7 Aug 2011 15:11:48 +0000 (17:11 +0200)
* testsuite/test-expandargv.c (writeout_test): Check result of fwrite.

From-SVN: r177547

libiberty/ChangeLog
libiberty/testsuite/test-expandargv.c

index 413319b289aa321928bfeee6bc158eef298bbd13..6742d92c9ee776b294a0ed75ffbe812e61f222e4 100644 (file)
@@ -1,3 +1,7 @@
+2011-08-06  Uros Bizjak  <ubizjak@gmail.com>
+
+       * testsuite/test-expandargv.c (writeout_test): Check result of fwrite.
+
 2011-04-28  Release Manager
 
        * GCC 4.5.3 released.
 
 2009-04-29  Julian Brown  <julian@codesourcery.com>
 
-       * 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.
        section, so that the native build does detect them at configure
        time.
        * configure: Regenerated.
-       
+
 2009-04-13  Ozkan Sezer  <sezeroz@gmail.com>
 
         PR target/39397
 2008-10-08  David Edelsohn  <edelsohn@gnu.org>
 
        * xstrdup.c: Include <sys/types.h> after "config.h"
+
 2008-10-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * configure.ac: Call AC_SYS_LARGEFILE.
index c16a0322a6c4b20ba77604f686e7cfd38a225d95..dc44a1750e8a2b2d6d5a1dcb550f1586682ef383 100644 (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);
 }