for (i = 0; i < count; i++) {
if (cur_pid != events[i].pid) {
if (pid_element_open) {
- /* Close the previous events and pid element */
+ /* Close the previous events and pid element */
ret = mi_lttng_close_multi_element(writer, 2);
if (ret) {
goto end;
{
int i, size, ret = CMD_SUCCESS;
struct lttng_domain domain;
- struct lttng_handle *handle;
- struct lttng_event *event_list;
+ struct lttng_handle *handle = NULL;
+ struct lttng_event *event_list = NULL;
pid_t cur_pid = 0;
char *cmdline = NULL;
const char *agent_domain_str;
domain.type = LTTNG_DOMAIN_LOG4J;
} else if (opt_python) {
domain.type = LTTNG_DOMAIN_PYTHON;
+ } else {
+ ERR("Invalid agent domain selected.");
+ ret = CMD_ERROR;
+ goto error;
}
agent_domain_str = get_domain_str(domain.type);