File: yes-errors

package info (click to toggle)
cssc 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 11,368 kB
  • sloc: cpp: 39,446; ansic: 17,403; sh: 11,328; python: 3,923; makefile: 1,929; perl: 342; awk: 15; sed: 15
file content (26 lines) | stat: -rw-r--r-- 826 bytes parent folder | download
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*/