Detect and exit on write errors.
This commit is contained in:
parent
9ca980d0e7
commit
dff8f5c919
@ -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*/
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user