1 /* vms/uexit.c: special exit command, to exit cleanly from VMS program.
2 
3    Copyright (c) 1990-94 Joshua Delahunty, James E. Wilson
4 
5    This software may be copied and distributed for educational, research, and
6    not for profit purposes provided that this copyright and statement are
7    included in all such copies. */
8 
9 /*	Unix programs usually return 0 for "good execution",
10 	and 1 for "some problem occured."  In VMS, we WANT the
11 	program to return a 1, or else we get an ugly
12 	"%NONAME-W-NOMSG, Message number 00000000"
13 	message upon image exit (yeech!).
14 
15 	So, we convert 0 exit codes to 1's, leaving all others alone.  */
16 
uexit(exitcode)17 void uexit(exitcode)
18 int exitcode;
19 {
20 	if (exitcode == 0)	/* On Unix, clean, on VMS, yeech! */
21 		exit(1);	/* converted... */
22 	else
23 		exit(exitcode); /* returned unscathed... */
24 }
25