[gs-devel] exit status on VMS and getting GS API working there

Forrest Cahoon forrest.cahoon at merrillcorp.com
Wed Apr 24 15:44:15 PDT 2002


> Does returning 0 from main() get treated as success or failure under VMS?

The value returned (using "return") from main acts the same way as exit()
on my system:
return 0 will give a (successful) exit code of 1, but return 1 also gives
the same exit code.

Forrest
not speaking for merrill corporation



                                                                                            
                    "Russell Lang"                                                          
                    <gsview at ghostg       To:     "Forrest Cahoon"                           
                    um.com.au>            <forrest.cahoon at merrillcorp.com>                  
                                         cc:     gs-devel at ghostscript.com                   
                    04/24/2002           Subject:     Re: [gs-devel] exit status on VMS and 
                    04:50 PM              getting GS API working there                      
                    Please respond                                                          
                    to gsview                                                               
                                                                                            
                                                                                            




Forrest,

> Since I never checked the exit status anyway, and am planning to use
> the gs api for more sophisticated error checking, I'm tempted to
> suggest that just giving up on getting the correct exit status for VMS
> is the best approach, so that gp_do_exit() can be made an empty
> function and gsapi_exit() works correctly.  Since the exit status has
> apparently been broken for quite a while now, there would be no loss
> of functionality in doing so.

In my opinion, the correct approach is to make gp_do_exit()
an empty function, and to handle the exit code (if needed)
in the return value from main() in gs.c.  Does returning 0
from main() get treated as success or failure under VMS?

I removed nearly all occurences of exit in Ghostscript. The
remaining ones tended to be fatal error aborts.
exit is a very antisocial function to call in a DLL /
shared object.


Russell Lang                   gsview at ghostgum.com.au
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/









More information about the gs-devel mailing list