X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=24c3b8ca146ff1fafe8de8da3dd059c7f947f415;hb=b61e1dca934c1cda7632d154c243dcf56aabac60;hp=1e52ae0aa073640a34f8b035376bb6b5119d5660;hpb=b5b0c181b9f47edd4be6fd1f70835f232c0d56fd;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index 1e52ae0aa..24c3b8ca1 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -528,7 +528,7 @@ int utils_create_lock_file(const char *filepath) S_IRGRP | S_IWGRP); if (fd < 0) { PERROR("open lock file %s", filepath); - ret = -1; + fd = -1; goto error; } @@ -1335,15 +1335,17 @@ LTTNG_HIDDEN 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: @@ -1375,11 +1377,11 @@ int utils_show_man_page(int section, const char *page_name) /* * 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; }