aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog4
-rw-r--r--admin/notes/exit-value43
2 files changed, 22 insertions, 25 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 7da79325a94..34dc8c9c5c0 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,5 +1,9 @@
12014-08-07 Reuben Thomas <rrt@sc3d.org> 12014-08-07 Reuben Thomas <rrt@sc3d.org>
2 2
3 * notes/exit-value: Remove specific discussion of VMS.
4
52014-08-07 Reuben Thomas <rrt@sc3d.org>
6
3 Refer to MS-DOS using the same name everywhere. 7 Refer to MS-DOS using the same name everywhere.
4 8
5 * FOR-RELEASE: ``MS-DOG'', ``MSDOG'' and ``msdog'' become 9 * FOR-RELEASE: ``MS-DOG'', ``MSDOG'' and ``msdog'' become
diff --git a/admin/notes/exit-value b/admin/notes/exit-value
index cad6862c8aa..96337e4c8dd 100644
--- a/admin/notes/exit-value
+++ b/admin/notes/exit-value
@@ -1,35 +1,28 @@
1ttn 2004-05-09 1ttn 2004-05-09
2 2
3The exit value of a program returning to the shell on unixoid systems is 3The exit value of a program returning to the shell on unixoid systems
4typically 0 for success, and non-0 (such as 1) for failure. For vms it is 4is typically 0 for success, and non-0 (such as 1) for failure. This is
5odd (1,3,5...) for success, even (0,2,4...) for failure. 5not always the case on other systems.
6 6
7This holds from the point of view of the "shell" (in quotes because vms has a 7From the point of view of the program stdlib.h provides macros
8different dispatch model that is not explained further here). 8`EXIT_SUCCESS' and `EXIT_FAILURE' that should DTRT. N.B. The
9 9numerical values of these macros DO NOT need to fulfill the exit value
10From the point of view of the program, nowadays stdlib.h on both type of 10requirements outlined in the first paragraph! That is the job of the
11systems provides macros `EXIT_SUCCESS' and `EXIT_FAILURE' that should DTRT.
12
13NB: The numerical values of these macros DO NOT need to fulfill the exit
14value requirements outlined in the first paragraph! That is the job of the
15`exit' function. Thus, this kind of construct shows misunderstanding: 11`exit' function. Thus, this kind of construct shows misunderstanding:
16 12
17 #ifdef VMS 13 #ifdef WEIRD_OS
18 exit (1); 14 exit (1);
19 #else 15 #else
20 exit (0); 16 exit (0);
21 #endif 17 #endif
22 18
23Values aside from EXIT_SUCCESS and EXIT_FAILURE are tricky. 19Values aside from EXIT_SUCCESS and EXIT_FAILURE are tricky, but can be
24 20used to indicate finer gradations of failure. If this is the only
25 21information available to the caller, clamping such values to
26 22EXIT_FAILURE loses information. If there are other ways to indicate
27ttn 2004-05-12 23the problem to the caller (such as a message to stderr) it may be ok
24to clamp. In all cases, it is the relationship between the program
25and its caller that must be examined.
28 26
29Values aside from EXIT_SUCCESS and EXIT_FAILURE can be used to indicate 27[Insert ZAMM quote here.] <-- I presume this refers to ``Zen and the
30finer gradations of failure. If this is the only information available 28Art of Motorcycle Maintenance'' - Reuben Thomas <rrt@sc3d.org>.
31to the caller, clamping such values to EXIT_FAILURE loses information.
32If there are other ways to indicate the problem to the caller (such as
33a message to stderr) it may be ok to clamp. In all cases, it is the
34relationship between the program and its caller that must be examined.
35[Insert ZAMM quote here.]