changeset 33495:ca6b44596772

test-select-stdin.c: avoid warn_unused_result warnings * tests/test-select-stdin.c: Include "macros.h". ASSERT that read and fflush succeed.
author Jim Meyering <meyering@redhat.com>
date Wed, 13 Oct 2010 11:22:35 +0200
parents cce4351ad325
children fe096a432501
files ChangeLog tests/test-select-stdin.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 13 22:11:31 2010 +0200
+++ b/ChangeLog	Wed Oct 13 11:22:35 2010 +0200
@@ -1,3 +1,9 @@
+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
--- a/tests/test-select-stdin.c	Wed Oct 13 22:11:31 2010 +0200
+++ b/tests/test-select-stdin.c	Wed Oct 13 11:22:35 2010 +0200
@@ -24,6 +24,8 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+#include "macros.h"
+
 int
 main (void)
 {
@@ -67,14 +69,15 @@
               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);
         }
     }
 }