Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!hoey@nrl-aic.arpa From: hoey@nrl-aic.arpa (Dan Hoey) Newsgroups: comp.lang.c Subject: Perror complication Message-ID: <8913@brl-adm.ARPA> Date: Thu, 20-Aug-87 15:46:46 EDT Article-I.D.: brl-adm.8913 Posted: Thu Aug 20 15:46:46 1987 Date-Received: Sat, 22-Aug-87 11:24:27 EDT Sender: news@brl-adm.ARPA Lines: 22 From: der Mouse Subject: Re: Accessing argc & argv from a functi Message-Id: <853@mcgill-vision.UUCP> Date: 5 Aug 87 07:33:09 GMT ... Well over half of all the calls to perror() I write look like perror((char *)0); because the prefix is more complicated than a single string, so I have fprintf(stderr,....); before the perror(). Then you had better save and restore errno around the call to fprintf, in case fprint makes a failing syscall. Wish perror() were printflike, perhaps like syslog() - syslog() accepts a printf format, except that %m means insert sys_errlst[errno]. Maybe that's why sendmail sometimes says ``Not a typewriter''? Dan Hoey HOEY@NRL-AIC.ARPA