if (ret != 0) {
errno = ret;
if (ret == ETIMEDOUT) {
+ int pth_ret;
+
/*
* Call has timed out so we kill the kconsumerd_thread and return
* an error.
*/
ERR("Condition timed out. The consumer thread was never ready."
" Killing it");
- ret = pthread_cancel(consumer_data->thread);
- if (ret < 0) {
+ pth_ret = pthread_cancel(consumer_data->thread);
+ if (pth_ret < 0) {
PERROR("pthread_cancel consumer thread");
}
} else {
PERROR("pthread_cond_wait failed consumer thread");
}
+ /* Caller is expecting a negative value on failure. */
+ ret = -1;
goto error;
}
consumer_to_use = consumerd32_bin;
} else {
DBG("Could not find any valid consumerd executable");
+ ret = -EINVAL;
break;
}
DBG("Using kernel consumer at: %s", consumer_to_use);
- execl(consumer_to_use,
+ ret = execl(consumer_to_use,
"lttng-consumerd", verbosity, "-k",
"--consumerd-cmd-sock", consumer_data->cmd_unix_sock_path,
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
if (consumerd64_libdir[0] != '\0') {
free(tmpnew);
}
- if (ret) {
- goto error;
- }
break;
}
case LTTNG_CONSUMER32_UST:
if (consumerd32_libdir[0] != '\0') {
free(tmpnew);
}
- if (ret) {
- goto error;
- }
break;
}
default:
exit(EXIT_FAILURE);
}
if (errno != 0) {
- PERROR("kernel start consumer exec");
+ PERROR("Consumer execl()");
}
+ /* Reaching this point, we got a failure on our execl(). */
exit(EXIT_FAILURE);
} else if (pid > 0) {
ret = pid;