1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Description: Cause test-utils/yes to stop on write error
Submitter got this tight-looping on EPIPE.
Author: Yann Dirson <dirson@debian.org>
Bug-Debian: https://bugs.debian.org/788863
Index: CSSC-1.4.1/testutils/yes.c
===================================================================
--- CSSC-1.4.1.orig/testutils/yes.c
+++ CSSC-1.4.1/testutils/yes.c
@@ -71,12 +71,14 @@ main(int argc, char *argv[])
concat(msg, argc, argv);
for (;;)
- puts(msg); /* this adds a trailing newline */
+ if (puts(msg) == EOF) /* this adds a trailing newline */
+ break;
}
else
{
for (;;)
- puts("yes"); /* this adds a trailing newline */
+ if (puts("yes") == EOF) /* this adds a trailing newline */
+ break;
}
/*NOTREACHED*/
|