- xfamily = facename;
- }
- //else: no such family, use default one instead
- }
-
- wxString xstyle;
- switch (style)
- {
- case wxITALIC: xstyle = wxT("i"); break;
- case wxSLANT: xstyle = wxT("o"); break;
- case wxNORMAL: xstyle = wxT("r"); break;
- default: xstyle = wxT("*"); break;
- }
-
- wxString xweight;
- switch (weight)
- {
- case wxBOLD:
- {
- fontSpec.Printf(wxT("-*-%s-bold-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("bold");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-heavy-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("heavy");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-extrabold-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("extrabold");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-demibold-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("demibold");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-black-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("black");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-ultrablack-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("ultrablack");
- break;
- }
- }
- break;
- case wxLIGHT:
- {
- fontSpec.Printf(wxT("-*-%s-light-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("light");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-thin-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("thin");
- break;
- }
- }
- break;
- case wxNORMAL:
- {
- fontSpec.Printf(wxT("-*-%s-medium-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("medium");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-normal-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("normal");
- break;
- }
- fontSpec.Printf(wxT("-*-%s-regular-*-*-*-*-*-*-*-*-*-*-*"),
- xfamily.c_str());
- if ( wxTestFontSpec(fontSpec) )
- {
- xweight = wxT("regular");
- break;
- }
- xweight = wxT("*");
- }
- break;
- default: xweight = wxT("*"); break;
- }
-
- wxString xregistry, xencoding;
- if ( encoding == wxFONTENCODING_DEFAULT )
- {
- // use the apps default
- encoding = wxFont::GetDefaultEncoding();
- }
-
- bool test = TRUE; // should we test for availability of encoding?
- switch ( encoding )
- {
- case wxFONTENCODING_ISO8859_1:
- case wxFONTENCODING_ISO8859_2:
- case wxFONTENCODING_ISO8859_3:
- case wxFONTENCODING_ISO8859_4:
- case wxFONTENCODING_ISO8859_5:
- case wxFONTENCODING_ISO8859_6:
- case wxFONTENCODING_ISO8859_7:
- case wxFONTENCODING_ISO8859_8:
- case wxFONTENCODING_ISO8859_9:
- case wxFONTENCODING_ISO8859_10:
- case wxFONTENCODING_ISO8859_11:
- case wxFONTENCODING_ISO8859_13:
- case wxFONTENCODING_ISO8859_14:
- case wxFONTENCODING_ISO8859_15:
+ // just block waiting for the child to exit
+ int status = 0;
+
+ int result = waitpid(execData.pid, &status, 0);
+#ifdef __DARWIN__
+ /* DE: waitpid manpage states that waitpid can fail with EINTR
+ if the call is interrupted by a caught signal. I suppose
+ that means that this ought to be a while loop.
+
+ The odd thing is that it seems to fail EVERY time. It fails
+ with a quickly exiting process (e.g. echo), and fails with a
+ slowly exiting process (e.g. sleep 2) but clearly after
+ having waited for the child to exit. Maybe it's a bug in
+ my particular version.
+
+ It works, however, from the CFSocket callback without this
+ trick but in that case it's used only after CFSocket calls
+ the callback and with the WNOHANG flag which would seem to
+ preclude it from being interrupted or at least make it much
+ less likely since it would not then be waiting.
+
+ If Darwin's man page is to be believed then this is definitely
+ necessary. It's just weird that I've never seen it before
+ and apparently no one else has either or you'd think they'd
+ have reported it by now. Perhaps blocking the GUI while
+ waiting for a child process to exit is simply not that common.
+ */
+ if(result == -1 && errno == EINTR)