From: Julien Desfossez Date: Tue, 20 Mar 2012 15:19:14 +0000 (-0400) Subject: Fix: lttng view, error message and exit code X-Git-Tag: v2.0.0-rc4~11 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=0c687325f18ccb6950cd6a8a9665f33a6890d5a1 Fix: lttng view, error message and exit code lttng view is a frontend command, when the viewer is not found in the path, the error message should be human readable (no need for the developper-oriented debug message). Also the return code must indicate that something went wrong if the viewer is not on the system. (fix #144) Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/commands/view.c b/src/bin/lttng/commands/view.c index 9e7c9d91e..9508743e6 100644 --- a/src/bin/lttng/commands/view.c +++ b/src/bin/lttng/commands/view.c @@ -258,7 +258,11 @@ static int spawn_viewer(const char *trace_path) ret = execvp(viewer_bin, argv); if (ret) { - PERROR("exec: %s", viewer_bin); + if (errno == ENOENT) { + ERR("%s not found on the system", viewer_bin); + } else { + PERROR("exec: %s", viewer_bin); + } free(argv); ret = CMD_FATAL; goto error; @@ -346,8 +350,6 @@ static int view_trace(void) goto free_sessions; } - ret = CMD_SUCCESS; - free_sessions: if (sessions) { free(sessions);