Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!gwyn
From: gwyn@brl-tgr.ARPA (Doug Gwyn )
Newsgroups: net.lang.c
Subject: Re: Re:  casts to void
Message-ID: <701@brl-tgr.ARPA>
Date: Thu, 15-Aug-85 02:46:07 EDT
Article-I.D.: brl-tgr.701
Posted: Thu Aug 15 02:46:07 1985
Date-Received: Sun, 18-Aug-85 03:13:22 EDT
References: <485@brl-tgr.ARPA> <361@baylor.UUCP>
Organization: Ballistic Research Lab
Lines: 13

> OK. What should my whizzbang filter do when a write fails, other than
> write an error message and quit?

The canonical UNIX tool should write a message such as "prog: write
failed" to stderr (which may be writable even though stdout has a
problem), restore terminal modes if necessary, remove temporary files,
etc. then exit with a non-zero status code (so that the invoker of the
program can detect the problem and take whatever strategic measures
are needed).

Other more specialized programs may need to take other actions opon
occurrence of an error.  The important point is to DETECT that an
error has occurred, then take appropriate steps (usually, REPORT it).