1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-22 06:50:52 +03:00

cov: some error path updates

This commit is contained in:
Zdenek Kabelac 2025-01-07 15:33:58 +01:00
parent 8fb58826c0
commit 14673b2746

View File

@ -123,7 +123,7 @@ static int _reopen_fd_to_null(int fd)
return 0;
}
if (close(fd)) {
if ((null_fd != fd) && close(fd)) {
log_sys_error("close", "");
goto out;
}
@ -194,6 +194,8 @@ FILE *pipe_open(struct cmd_context *cmd, const char *const argv[],
/* Parent -> reader */
if (close(pipefd[1 /*write*/])) {
log_sys_error("close", "STDOUT");
if (close(pipefd[0 /*read*/]))
log_sys_debug("close", "pipe[0]");
return NULL;
}