Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!pur-ee!uiucdcs!parsec!ctvax!uokvax!jab From: jab@uokvax.UUCP Newsgroups: net.unix Subject: Re: 'exit(1);' considered useless (sligh - (nf) Message-ID: <5456@uiucdcs.UUCP> Date: Tue, 7-Feb-84 23:48:15 EST Article-I.D.: uiucdcs.5456 Posted: Tue Feb 7 23:48:15 1984 Date-Received: Fri, 10-Feb-84 01:45:14 EST Lines: 29 #R:proper:-95700:uokvax:6100019:000:1154 uokvax!jab Feb 5 21:26:00 1984 /***** uokvax:net.unix / proper!gam / 6:58 pm Feb 2, 1984 */ As a maintainer and supporter of existing software, I am getting tired of programs whose terminating action is: exit(1); /* ------------- */ This person has a point, and there's a response saying "well, use 'perror'". However, the "exit code" is something that classically was taken as a boolean, meaning "yes, it worked" or "no, it didn't work". I won't defend that, but let me remind you that in certain parts of the software world, those exit codes are all important. Imagine the following exit status: #define DIEDHORRIBLY 03231 where if the program exists with "DIEDHORRIBLY", something terrible has happened and the shell should log the user out. VAX/VMS has such a status, and in fact, the command interpreter is responsible for telling you what went wrong (it gets its information from, you guessed it, the exit status.) No matter how bad it seems, there's always something worse. Probably the most handy set of exit codes are of the form where one status means "what you requested was stupid" and another means "well, I did what you told me and got nothing". Jeff Bowles