/* Fehlerabfragen */
/* Datei: fehler.c */

#include <stdio.h>
#include <stdlib.h>    /* für exit() */
#include <errno.h>

int main (void)
 {
 int c;

 do
  {
  c = getchar();
  if (c == EOF)
     {
     if ( ferror (stdin) )
	{
	if (errno == EINTR)
	   {
	   c = !EOF;
	   continue;
	   }
	else
	   exit (3);
	}
     if (feof(stdin)) 
	continue;
     }
  putchar (c);
  }
  while (c != EOF);
  return 0;
 }
