X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fopenocd.c;h=81aae3909de5d0cd70053d5942f880192ff24fd4;hb=ed36a8d15dfd04e47d23d5f1e09078f105785fb1;hp=4fbaf467e83f3ce939116c02f161eb09a31d7ee3;hpb=5ed126c4f90948fbf53d186dc4ef49018fb5ecfc;p=openocd.git diff --git a/src/openocd.c b/src/openocd.c index 4fbaf467e8..81aae3909d 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#define OPENOCD_VERSION "Open On-Chip Debugger (2007-03-15 14:30 CET)" +#define OPENOCD_VERSION "Open On-Chip Debugger (2007-09-05 09:00 CEST)" #ifdef HAVE_CONFIG_H #include "config.h" @@ -57,6 +57,13 @@ int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char ** return ERROR_OK; } +void exit_handler(void) +{ + /* close JTAG interface */ + if (jtag && jtag->quit) + jtag->quit(); +} + int main(int argc, char *argv[]) { /* initialize commandline interface */ @@ -99,6 +106,8 @@ int main(int argc, char *argv[]) command_set_output_handler(cmd_ctx, configuration_output_handler, NULL); + atexit(exit_handler); + if (jtag_init(cmd_ctx) != ERROR_OK) return EXIT_FAILURE; DEBUG("jtag init complete");