From 1310dca184dcb2d06d82d0c9022978b6ad20f5a4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Jan 2010 01:06:52 +0000 Subject: [PATCH] log system() exit status when it is non zero to avoid warnings and to inform people git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1697 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 2 ++ urjtag/src/cmd/cmd_shell.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 34f43dc8..5b78435c 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -6,6 +6,8 @@ * src/tap/cable/jlink.c (jlink_debug_buffer): Unify log lines to avoid printf format security warnings. + * src/cmd/cmd_shell.c (cmd_shell_run): Log non-zero shell exit status. + 2010-01-21 Jie Zhang * src/apps/jtag/jtag.c (main): Don't trigger open file error diff --git a/urjtag/src/cmd/cmd_shell.c b/urjtag/src/cmd/cmd_shell.c index e80b6816..d608702b 100644 --- a/urjtag/src/cmd/cmd_shell.c +++ b/urjtag/src/cmd/cmd_shell.c @@ -78,9 +78,12 @@ cmd_shell_run (urj_chain_t *chain, char *params[]) } urj_log (URJ_LOG_LEVEL_NORMAL, "Executing '%s'\n", shell_cmd); - system (shell_cmd); + i = system (shell_cmd); free (shell_cmd); + if (i) + urj_log (URJ_LOG_LEVEL_NORMAL, "shell returned %i\n", i); + return URJ_STATUS_OK; }