Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site proper.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!intelca!proper!gam From: gam@proper.UUCP (Gordon Moffett) Newsgroups: net.unix,net.lang.c Subject: Re: 'exit(1);' considered useless (slight flame) Message-ID: <968@proper.UUCP> Date: Fri, 3-Feb-84 15:18:28 EST Article-I.D.: proper.968 Posted: Fri Feb 3 15:18:28 1984 Date-Received: Thu, 9-Feb-84 02:08:45 EST References: <957@proper.UUCP>, <232@hou3c.UUCP> Organization: Proper UNIX, San Leandro, CA Lines: 30 Indeed, the example given (with no error message printed out) was contrived and unforgivable practice. However, why shouldn't errno be used as an exit status indicator? At least within Unix-variants, those values are quite specific, and readily looked up in the manuals. And, as I implied in my original article, why not more use of perror(3)? I find error messages such as: "can't open file" are frustratingly trite (and all too common), when one could have easily used perror(3) to produce more meaningful messages as: "no such file or directory" or "permission denied" or "too many open files" which would help speed up tracking down the error. (and of course, including the name of the file in the error message would be nice). By this article, I am seeking to make more programmers aware of the importance of good error messages, so as to make all our work easier. -- Gordon A. Moffett { allegra, decvax!decwrl } !amd70!proper hplabs!intelca!proper!gam