mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
cov: explicit ignore if failures
Here we can't do anything better than just ignore syscall failures (with silence as there is no loging mechanism)
This commit is contained in:
parent
79879bd201
commit
bc1976011a
@ -42,18 +42,18 @@ static bool _open_child(struct child_process *child, const char *cmd, const char
|
||||
|
||||
child->pid = fork();
|
||||
if (child->pid < 0) {
|
||||
close(pipe_fd[0]);
|
||||
close(pipe_fd[1]);
|
||||
(void) close(pipe_fd[0]);
|
||||
(void) close(pipe_fd[1]);
|
||||
_error("call to fork() failed: %d\n", r);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (child->pid == 0) {
|
||||
// child
|
||||
close(pipe_fd[0]);
|
||||
(void) close(pipe_fd[0]);
|
||||
if (pipe_fd[1] != STDOUT_FILENO) {
|
||||
dup2(pipe_fd[1], STDOUT_FILENO);
|
||||
close(pipe_fd[1]);
|
||||
(void) dup2(pipe_fd[1], STDOUT_FILENO);
|
||||
(void) close(pipe_fd[1]);
|
||||
}
|
||||
|
||||
if (execv(cmd, (char *const *) argv) < 0)
|
||||
@ -62,7 +62,7 @@ static bool _open_child(struct child_process *child, const char *cmd, const char
|
||||
exit(1);
|
||||
} else {
|
||||
// parent
|
||||
close(pipe_fd[1]);
|
||||
(void) close(pipe_fd[1]);
|
||||
child->fp = fdopen(pipe_fd[0], "r");
|
||||
if (!child->fp) {
|
||||
_error("call to fdopen() failed\n");
|
||||
@ -78,7 +78,7 @@ static bool _close_child(struct child_process *child)
|
||||
{
|
||||
int status;
|
||||
|
||||
fclose(child->fp);
|
||||
(void) fclose(child->fp);
|
||||
|
||||
while (waitpid(child->pid, &status, 0) < 0)
|
||||
if (errno != EINTR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user