]> sourceware.org Git - lvm2.git/commitdiff
cov: some error path updates
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 7 Jan 2025 14:33:58 +0000 (15:33 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Jan 2025 23:20:19 +0000 (00:20 +0100)
lib/misc/lvm-exec.c

index 203e2dff42970bd4f91b036b6614fa54e8618f0f..f10173fef56f6353228129682ad85e502d307bde 100644 (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;
        }
 
This page took 0.035294 seconds and 5 git commands to generate.