test-select-stdin.c: avoid warn_unused_result warnings
authorJim Meyering <meyering@redhat.com>
Wed, 13 Oct 2010 09:22:35 +0000 (11:22 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 14 Oct 2010 07:28:58 +0000 (09:28 +0200)
* tests/test-select-stdin.c: Include "macros.h".
ASSERT that read and fflush succeed.

ChangeLog
tests/test-select-stdin.c

index 14b10e8..cb8fa31 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-10-13  Jim Meyering  <meyering@redhat.com>
 
+       test-select-stdin.c: avoid warn_unused_result warnings
+       * tests/test-select-stdin.c: Include "macros.h".
+       ASSERT that read and fflush succeed.
+
+2010-10-13  Jim Meyering  <meyering@redhat.com>
+
        git-version-gen: do require git-VC'd files in cwd
        * build-aux/git-version-gen: Reject a git version string
        if there are no commits associated with the current directory.
index e9cee96..c88698c 100644 (file)
@@ -24,6 +24,8 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+#include "macros.h"
+
 int
 main (void)
 {
@@ -67,14 +69,15 @@ main (void)
               exit (1);
             }
           /* Timeout */
-          printf ("."); fflush (stdout);
+          printf (".");
+          ASSERT (fflush (stdout) == 0);
         }
       else
         {
           char c;
 
           printf ("Input available! Trying to read 1 byte...\n");
-          read (0, &c, 1);
+          ASSERT (read (0, &c, 1) == 1);
         }
     }
 }