So in this commit, you'll notice how you made the child exit. Instead of the child exiting, have it send the parent a "close" message via write() and let it return. When the parent gets that particular message, it'll kick out of the while loop, then should bu_exit().
That way, the child will live on in place of the parent. Looked a little into the conversion towards Tcl routines, and it's not so simple so that idea can probably be shelved for now. Next steps would probably be adding checks for return codes, unifying the writes/reads into one, and quellage. Cheers! Sean On Tuesday, March 02, 2010, at 01:37PM, <[email protected]> wrote: >Revision: 37852 > http://brlcad.svn.sourceforge.net/brlcad/?rev=37852&view=rev >Author: starseeker >Date: 2010-03-02 18:37:14 +0000 (Tue, 02 Mar 2010) > >Log Message: >----------- >Don't need the specific logic for children vs parent - if it's a child it >needs it and if its the parent it should never get to it. > >Modified Paths: >-------------- > brlcad/trunk/src/libfb/if_tk.c > >Modified: brlcad/trunk/src/libfb/if_tk.c >=================================================================== >--- brlcad/trunk/src/libfb/if_tk.c 2010-03-02 18:31:07 UTC (rev 37851) >+++ brlcad/trunk/src/libfb/if_tk.c 2010-03-02 18:37:14 UTC (rev 37852) >@@ -45,8 +45,6 @@ > Tk_PhotoHandle fbphoto; > int p[2] = {0, 0}; > >-int is_child = 0; >- > /* Note that Tk_PhotoPutBlock claims to have a faster > * copy method when pixelSize is 4 and alphaOffset is > * 3 - perhaps output could be massaged to generate this >@@ -314,7 +312,6 @@ > /* child */ > printf("IMA CHILD\n"); > fflush(stdout); >- is_child = 1; > } > } > >@@ -324,20 +321,7 @@ > HIDDEN int > fb_tk_close(FBIO *ifp) > { >- if (is_child == 0){ >- FB_CK_FBIO(ifp); >- fb_log( "fb_close( 0x%lx )\n", (unsigned long)ifp ); >- fclose(stdin); >- // Wait for CloseWindow to be changed by the WM_DELETE_WINDOW >- // binding set up in fb_tk_open >- Tcl_Eval(fbinterp, "vwait CloseWindow"); >- if (!strcmp(Tcl_GetVar(fbinterp, "CloseWindow", 0),"close")) { >- Tcl_Eval(fbinterp, "destroy ."); >- return 0; >- } >- } else { >- exit(0); >- } >+ bu_exit(0, NULL); > } > > HIDDEN int >@@ -371,7 +355,6 @@ > int line[2]; > > FB_CK_FBIO(ifp); >-if (is_child == 1) { > /* Set local values of Tk_PhotoImageBlock */ > block.pixelPtr = (unsigned char *)pixelp; > block.width = count; >@@ -423,10 +406,7 @@ > } while (i); > #endif > return count; >-} else { >- return 0; > } >-} > > HIDDEN int > tk_rmap(FBIO *ifp, ColorMap *cmp) > > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ BRL-CAD Developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/brlcad-devel
