Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.173
 
1.174
 
MAIN:plunky:20121017101444
 
cpp.c
_>153153         struct symtab *nl;
 154154         register int ch;
 155155         const usch *fn1, *fn2;
<>156 -        int dummy;
157156 
 158157 #ifdef TIMING
 159158         struct timeval t1, t2;
     
 !
217216                         break;
 218217 #endif
 219218                 case 'v':
<>220 -                        dummy = write(2, versstr, sizeof(versstr) - 1);
  219+                        xwrite(2, versstr, sizeof(versstr) - 1);
221220                         break;
 222221 
 223222                 case 'x':
     
 !
935934 {
 936935         usch *t;
 937936         usch *sb = stringbuf;
<>938 -        int dummy;
939937 
 940938         flbuf();
 941939         savch(0);
 942940         if (ifiles != NULL) {
 943941                 t = sheap("%s:%d: warning: ", ifiles->fname, ifiles->lineno);
<>944 -                dummy = write (2, t, strlen((char *)t));
  942+                xwrite(2, t, strlen((char *)t));
945943         }
<>946 -        dummy = write (2, s, strlen((char *)s));
 947 -        dummy = write (2, "\n", 1);
  944+        xwrite(2, s, strlen((char *)s));
  945+        xwrite(2, "\n", 1);
948946         stringbuf = sb;
 949947 }
 950948 
 951949 void
 952950 xerror(usch *s)
 953951 {
 954952         usch *t;
<>955 -        int dummy;
956953 
 957954         flbuf();
 958955         savch(0);
 959956         if (ifiles != NULL) {
 960957                 t = sheap("%s:%d: error: ", ifiles->fname, ifiles->lineno);
<>961 -                dummy = write (2, t, strlen((char *)t));
  958+                xwrite(2, t, strlen((char *)t));
962959         }
<>963 -        dummy = write (2, s, strlen((char *)s));
 964 -        dummy = write (2, "\n", 1);
  960+        xwrite(2, s, strlen((char *)s));
  961+        xwrite(2, "\n", 1);
965962         exit(1);
 966963 }
 967964 
     
 !
18861883 {
 18871884         if (obufp == 0)
 18881885                 return;
<>1889 -        if (Mflag == 0 && write(ofd, outbuf, obufp) < 0)
 1890 -                error("obuf write error");
  1886+        if (Mflag == 0)
  1887+                xwrite(ofd, outbuf, obufp);
18911888         lastoch = outbuf[obufp-1];
 18921889         obufp = 0;
 18931890 }
     
 !
21432140         strlcpy((char *)rv, (const char *)str, len);
 21442141         return rv;
 21452142 }
<_ 2143+
  2144+void
  2145+xwrite(int fd, const void *buf, unsigned int len)
  2146+{
  2147+        if (write(fd, buf, len) != (int)len) {
  2148+                if (fd == 2)
  2149+                        exit(2);
  2150+                error("write error");
  2151+        }
  2152+}
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-25 01:49 +0100