X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Futils.cpp;fp=src%2Fcommon%2Futils.cpp;h=89ef0e54fd01714ea866c05dd2424cd1f21c26e5;hp=6c0fd261c7b8a4033d5eb35cc7247af509ddfca3;hb=9a30ba1da4e6d59eb30c6535a9dd04cd599e6fae;hpb=de5abcb02431896a1827dff5d3376e1f2e124cd7 diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 6c0fd261c..89ef0e54f 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -228,7 +228,10 @@ int utils_create_pid_file(pid_t pid, const char *filepath) if (fp == NULL) { PERROR("fdopen file %s", filepath); ret = -1; - close(fd); + if (close(fd)) { + PERROR("Failed to close `%s` file descriptor while handling fdopen error", filepath); + } + goto error; }