Detect and exit on write errors.

This commit is contained in:
tjr 2002-11-08 02:51:31 +00:00
parent 9ca980d0e7
commit dff8f5c919

View File

@ -51,8 +51,11 @@ int
main(int argc, char **argv)
{
if (argc > 1)
for(;;)
puts(argv[1]);
else for (;;)
puts("y");
while (puts(argv[1]) != EOF)
;
else
while (puts("y") != EOF)
;
err(1, "stdout");
/*NOTREACHED*/
}