error:
free(resolved_path);
free(cut_path);
+ free(try_path);
+ if (try_path_prev != try_path) {
+ free(try_path_prev);
+ }
return NULL;
}
S_IRGRP | S_IWGRP);
if (fd < 0) {
PERROR("open lock file %s", filepath);
- ret = -1;
+ fd = -1;
goto error;
}
PERROR("Closing tracefile");
goto error;
}
+ *stream_fd = -1;
if (count > 0) {
/*
int utils_truncate_stream_file(int fd, off_t length)
{
int ret;
+ off_t lseek_ret;
ret = ftruncate(fd, length);
if (ret < 0) {
PERROR("ftruncate");
goto end;
}
- ret = lseek(fd, length, SEEK_SET);
- if (ret < 0) {
+ lseek_ret = lseek(fd, length, SEEK_SET);
+ if (lseek_ret < 0) {
PERROR("lseek");
+ ret = -1;
goto end;
}
end:
static const char *get_man_bin_path(void)
{
- char *env_man_path = getenv(DEFAULT_MAN_BIN_PATH_ENV);
+ char *env_man_path = lttng_secure_getenv(DEFAULT_MAN_BIN_PATH_ENV);
if (env_man_path) {
return env_man_path;
/*
* Execute man pager.
*
- * We provide --manpath to man here because LTTng-tools can
+ * We provide -M to man here because LTTng-tools can
* be installed outside /usr, in which case its man pages are
* not located in the default /usr/share/man directory.
*/
- ret = execlp(man_bin_path, "man", "--manpath", MANPATH,
+ ret = execlp(man_bin_path, "man", "-M", MANPATH,
section_string, page_name, NULL);
return ret;
}