There are about 12 places in os/utils.c and os/xdmcp.c where a call is made to
exit(1), often in unison with a call to ErrorF. Calling exit(1) directly
prevents the DDX layer from doing its thing in the OsVendorFatalError (on Cygwin
this is used to popup a message box point the user to support information).
All of these calls to exit(1) occur in functions and files where calls to
FatalError are also made, and some of these are as trivial as a command-line
argument being malformed (which has no reason for bypassing FatalError).
These patches leave intact the following valid calls to exit() in the OS layer:
1) utils.c/AutoResetServer - Looks to be intentional here.
2) utils.c/ProcessCommandLine - "-help" processing after UseMsg() returns.
3) utils.c/System,Popen,Fopen - After calls to fork().
4) log.c/AbortServer - Happens after AbortDDX is called, valid.
5) xdmcp.c - None (all direct calls to exit were removed).
I took care to preserve the placement of the ErrorF messages at the top of the
log file (sometimes printed above UseMsg output) and duplicated such message in
a final call to FatalError. In simpler cases not involving other output I
directly replaced the ErrorF and exit calls with a single call to FatalError.
This patch has been build and run tested on Cygwin and I consider it extremely safe.
I will be committing this barring any unusually strong protest.
Created attachment 142 [details] [review]
Remove exit(1) calls from os/utils.c
Created attachment 143 [details] [review]
Remove exit(1) calls from os/xdmcp.c
Yay, I already committed this and forgot about it. CVS commit message below.
Module name: xc
Changes by: harold@pdx. 04/03/02 11:27:34
Replace a handful of calls to ErrorF and exit(1) with a single call to
FatalError. These direct calls to exit(1) made it impossible to do anything
ddx-specific in these cases; note that most of these calls occur during argument
xc/programs/Xserver/os/: Tag: XORG-RELEASE-1
Revision Changes Path
126.96.36.199.2.2 +3 -3 xc/programs/Xserver/os/utils.c
188.8.131.52.2.1 +17 -33 xc/programs/Xserver/os/xdmcp.c