Make sure success is put to zero when an error happens
ret = lttng_snapshot_del_output(current_session_name, output);
if (ret < 0) {
ret = lttng_snapshot_del_output(current_session_name, output);
if (ret < 0) {
/* This call, if successful, populates the id of the output object. */
ret = lttng_snapshot_add_output(current_session_name, output);
if (ret < 0) {
/* This call, if successful, populates the id of the output object. */
ret = lttng_snapshot_add_output(current_session_name, output);
if (ret < 0) {
- /* Overwrite ret if an error occured in cmd->func() */
+ /* Overwrite ret if an error occurred in cmd->func() */
ret = command_ret ? command_ret : ret;
return ret;
}
ret = command_ret ? command_ret : ret;
return ret;
}
}
command_ret = handle_command(poptGetArgs(pc));
}
command_ret = handle_command(poptGetArgs(pc));
switch (-command_ret) {
case LTTNG_ERR_EPERM:
ERR("The session needs to be set in no output mode (--no-output)");
switch (-command_ret) {
case LTTNG_ERR_EPERM:
ERR("The session needs to be set in no output mode (--no-output)");