Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.bugs.4bsd Subject: Re: sendmail and others print bogus `Not a typewriter' errors Message-ID: <8210@mimsy.UUCP> Date: Thu, 27-Aug-87 19:55:58 EDT Article-I.D.: mimsy.8210 Posted: Thu Aug 27 19:55:58 1987 Date-Received: Sat, 29-Aug-87 12:13:54 EDT References: <8192@mimsy.UUCP> <6348@brl-smoke.ARPA> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 21 In article <6348@brl-smoke.ARPA> gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: >... The real problem is programmers who invoke perror() when errno is >not guaranteed to be set up correctly to indicate an error cause. Agreed. Yet I think more section-3 routines should take care with errno; in particular, those routines that can fail due to failing system calls should arrange to set errno always upon failing. For instance, if ((f = fopen(tmp, "w")) == NULL) { perror("cannot create temp file"); ... is technically wrong, but most often produces what is desired. It should always produce what is desired, or there should be a better mechanism. (A global error number is rather grotty.) Restoring errno inside isatty() is not a proper fix, but may help reduce confusion until we get one. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris