Revision: 54861
http://brlcad.svn.sourceforge.net/brlcad/?rev=54861&view=rev
Author: brlcad
Date: 2013-03-26 00:11:17 +0000 (Tue, 26 Mar 2013)
Log Message:
-----------
remove the debug printing to the non-portable /tmp/stdout file, makes several
bogus assumptions. also be sure to remove our bu_log hook that redirects
output to the GUI when we're closing the application. there may be other calls
to bu_log() that will crash after Tcl is shut down.
Modified Paths:
--------------
brlcad/trunk/src/mged/mged.c
Modified: brlcad/trunk/src/mged/mged.c
===================================================================
--- brlcad/trunk/src/mged/mged.c 2013-03-25 21:41:34 UTC (rev 54860)
+++ brlcad/trunk/src/mged/mged.c 2013-03-26 00:11:17 UTC (rev 54861)
@@ -1048,13 +1048,13 @@
int c;
int read_only_flag=0;
+ int stdfd[2] = {0, 0};
int parent_pipe[2] = {0, 0};
int use_pipe = 0;
int run_in_foreground=1;
Tcl_Channel chan;
struct timeval timeout;
- FILE *out = stdout;
#if !defined(_WIN32) || defined(__CYGWIN__)
fd_set read_set;
@@ -1142,11 +1142,6 @@
argc -= bu_optind;
argv += bu_optind;
- if (bu_debug > 0)
- out = fopen("/tmp/stdout", "w+"); /* I/O testing */
- if (!out)
- out = stdout;
-
if (argc > 1) {
/* if there is more than a file name remaining, mged is not interactive
*/
interactive = 0;
@@ -1160,7 +1155,7 @@
FD_SET(fileno(stdin), &read_set);
result = select(fileno(stdin)+1, &read_set, NULL, NULL, &timeout);
if (bu_debug > 0)
- fprintf(out, "DEBUG: select result: %d, stdin read: %d\n", result,
FD_ISSET(fileno(stdin), &read_set));
+ fprintf(stdout, "DEBUG: select result: %d, stdin read: %d\n",
result, FD_ISSET(fileno(stdin), &read_set));
if (result > 0 && FD_ISSET(fileno(stdin), &read_set)) {
/* stdin pending, probably not interactive */
@@ -1171,7 +1166,7 @@
FD_SET(fileno(stdin), &exception_set);
result = select(fileno(stdin)+1, NULL, NULL, &exception_set,
&timeout);
if (bu_debug > 0)
- fprintf(out, "DEBUG: select result: %d, stdin exception: %d\n",
result, FD_ISSET(fileno(stdin), &exception_set));
+ fprintf(stdout, "DEBUG: select result: %d, stdin exception:
%d\n", result, FD_ISSET(fileno(stdin), &exception_set));
/* see if there's valid input waiting (more reliable than select) */
if (result > 0 && FD_ISSET(fileno(stdin), &exception_set)) {
@@ -1183,7 +1178,7 @@
result = poll(&pfd, 1, 100);
if (bu_debug > 0)
- fprintf(out, "DEBUG: poll result: %d, revents: %d\n",
result, pfd.revents);
+ fprintf(stdout, "DEBUG: poll result: %d, revents: %d\n",
result, pfd.revents);
if (pfd.revents & POLLNVAL) {
interactive = 1;
@@ -1200,14 +1195,10 @@
} /* read_set */
#endif
- if (bu_debug && out != stdout) {
- fflush(out);
- fclose(out);
- }
} /* argc > 1 */
if (bu_debug > 0)
- fprintf(out, "DEBUG: interactive=%d, classic_mged=%d\n", interactive,
classic_mged);
+ fprintf(stdout, "DEBUG: interactive=%d, classic_mged=%d\n",
interactive, classic_mged);
#if defined(SIGPIPE) && defined(SIGINT)
@@ -2477,6 +2468,12 @@
bu_vls_free(&c->cl_more_default);
}
+ /* no longer send bu_log() output to Tcl */
+ bu_log_delete_hook(gui_output, (genptr_t)INTERP);
+
+ /* restore stdout/stderr */
+ /* !!! */
+
/* Be certain to close the database cleanly before exiting */
Tcl_Preserve((ClientData)INTERP);
Tcl_Eval(INTERP, "rename " MGED_DB_NAME " \"\"; rename .inmem \"\"");
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits