bug in error(1)
Pete Story
pete at kvvax4.UUCP
Sun Jan 4 19:59:59 AEST 1970
<for mailers?>
If you use error(1) to put error messages back into source files, and you
happen to get a full file system or other write errors, you are going
to lose your source. Here is a fix, with no guarantees (my file system
isn't full any more, so I can't test it).
1a2,6
> /* KV id : @(#)errortouch.c 1.2
> * modified : Fri Feb 10 15:30:45 GMT+1:00 1984, by pete
> * to check the return codes from fwrite and avoid losing sources on
> * full file systems, etc
> */
385c390,394
< fwrite(edbuffer, 1, bytes_read, n_touchedfile);
---
> if (fwrite(edbuffer, 1, bytes_read, n_touchedfile) != bytes_read) {
> fprintf(stderr,"%s: write error in touching, no change made\n",
> processname);
> return(-1);
> }
--
Pete Story {decvax,philabs}!mcvax!kvport!kvvax4!pete
A/S Kongsberg Vaapenfabrikk, PO Box 25, N3601 Kongsberg, Norway
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list