#include <version.h>
#include <lttng/lttng.h>
#include <common/common.h>
+#include <common/spawn-viewer.h>
#include <common/utils.h>
-#define DEFAULT_VIEWER "babeltrace"
-
#define COPY_BUFLEN 4096
#define RB_CRASH_DUMP_ABI_LEN 32
}
}
- if (!opt_viewer_path) {
- opt_viewer_path = (char *) DEFAULT_VIEWER;
- }
-
/* No leftovers, or more than one input path, print usage and quit */
if (argc - optind != 1) {
ERR("Command-line error: Specify exactly one input path");
}
static
-int view_trace(const char *viewer_path, const char *trace_path)
+int view_trace(const char *trace_path, char *viewer_path)
{
pid_t pid;
/* Child */
int ret;
- ret = execlp(viewer_path, viewer_path,
- trace_path, (char *) NULL);
+ ret = spawn_viewer(trace_path, viewer_path, false);
if (ret) {
- PERROR("execlp");
exit(EXIT_FAILURE);
}
- exit(EXIT_SUCCESS); /* Never reached */
+ /* Never reached */
+ exit(EXIT_SUCCESS);
}
return 0;
}
}
if (!opt_output_path) {
/* View trace */
- ret = view_trace(opt_viewer_path, output_path);
+ ret = view_trace(output_path, opt_viewer_path);
if (ret) {
has_warning = true;
}