X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=bc4f6112f9db4907e18dd9758f2a39105ca0a138;hb=f03ea3f43450abb1a1ea704044e1e8c78cfc0b4c;hp=682084c0f67d0cf32eb39bb2c9e76a5975a0f559;hpb=0f8f94b12c51004589e0ea668346a46b0412cf4f;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index 682084c0f..bc4f6112f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -240,7 +240,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; }