delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/07/19:31:49

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Exit Codes
Date: Wed, 07 Jan 1998 18:40:53 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 21
Message-ID: <34B41285.3FF1@cs.com>
References: <349D5986 DOT 56C6B72 AT spam DOT me> <3 DOT 0 DOT 5 DOT 32 DOT 19980102115918 DOT 00a05410 AT dictator DOT nt DOT tuwien DOT ac DOT at>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp217.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Anton Helm wrote:
> 
>    Exit Code 255 is therefore most likely caused by
>    exit(-1)
>    which is common usage (not standard!) for nonsuccessful
>    termination. If you like to keep to ANSI C standard
>    use the macros EXIT_SUCCESS and EXIT_FAILURE as exit codes.
>    (see stdlib.h for numerical values).

Actually, an exit code of -1 (255) is almost always caused by an
abnormal termination, such as Ctrl-C/Ctrl-Break or a crash.  Most
programs that I have seen either use the EXIT_* macros, or use a
positive code to indicate unsuccessful termination.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Sex should be friendly.  Otherwise  |
|       aka Fighteer I       | stick to mechanical toys; it's more  |
|   mailto:fighteer AT cs DOT com   | sanitary."                           |
| http://www.cs.com/fighteer |                - Lazarus Long        |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019