[GRASS-dev] Exit code for Tk GUI

Glynn Clements glynn at gclements.plus.com
Mon Sep 24 20:17:58 EDT 2007


Maris Nartiss wrote:

> TCL's close{} provides error code from launched module in "proc
> Gronsole::readeof" IF in "proc Gronsole::execbg " pipeline is not
> changed to be non-blocking (remove "fconfigure $fh -blocking 0").

Both Gronsole::destroy_command and Gronsole::execout close the stream
without recording the status (both silently "catch" any exception).

However: I'm not sure if it's meaningful for the GUI to report the
command's exit status. Once the GUI is created, you can run the
command multiple times (with different options each time).

What does "success" mean? That all of the runs succeeded? Or at least
one run? Or the last run?

I suspect that either:

1. G_gui() should simply exit(EXIT_SUCCESS) if it managed to spawn the
GUI and exit(EXIT_FAILURE) if it didn't, or:

2. G_gui() should return wish's exit code, and wish should report
success if it was terminated by the user (failure would imply that
wish crashed).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list