Den 2010-09-29 23:21 skrev Peter Rosin: > I'll think some more about the general issue. What I really would > like is a bash shopt to set the error mode from the shell when > running testsuites. Then we could really forget this issue. Either > that or some way to make MSYS not force the "default" error mode so > hard. I have tried to start MSYS with an inherited error mode, but > I couldn't make it stick. I guess I need to start digging in the > sources of those projects, and see if I can see what would be the > best/easiest solution.
Ok, since I find this: int flags = CREATE_DEFAULT_ERROR_MODE | GetPriorityClass (hMainProc); in spawn_guts, line 616 in (1), introducing a shopt in bash is with all likelihood going to be futile. I wonder if that CREATE_DEFAULT_ERROR_MODE can be made optional somehow, or even removed? I don't really see what good it's doing. Sure, it makes it certain how things are going to behave when you are not relying on inheriting the error mode, but it's rather inflexible. *thinks* Maybe MSYS processes set the error mode on init, and this flag is set here so that you do get the popup instead of just a "silent" exit status when you are running a program that e.g. is missing a dll? *digging some more* Yes, that appears to be the case, since I find this: (void) SetErrorMode (SEM_FAILCRITICALERRORS); in dll_crt0_1, line 670 in (2). So, it is not acceptable to simply remove CREATE_DEFAULT_ERROR_MODE above. Which means that *both* a shopt in the shell and some support for it in MSYS is going to be needed. Good luck with that, because I'm not going to try anytime soon. *thinks again* Maybe the shopt isn't needed after all. If the SetErrorMode call checks if the SEM_FAILCRITICALERRORS is already set, that could be used to determine if the CREATE_DEFAULT_ERROR_MODE flag should be added in spawn_guts. Then you could start an MSYS process with a custom error mode, and the error mode would be inherited. Hopefully anyway, I might easily have missed something... Cheers, Peter (1) http://mingw.cvs.sourceforge.net/viewvc/mingw/msys/rt/src/winsup/cygwin/spawn.cc?revision=1.29&view=markup (2) http://mingw.cvs.sourceforge.net/viewvc/mingw/msys/rt/src/winsup/cygwin/dcrt0.cc?revision=1.11&view=markup