mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-09 07:08:01 +02:00
save errno before closing fds in error path and restore
afterward.
This commit is contained in:
parent
79ee862f70
commit
aa4848fbc2
1 changed files with 4 additions and 0 deletions
|
|
@ -60,15 +60,19 @@ ply_open_unidirectional_pipe (int *sender_fd,
|
|||
|
||||
if (fcntl (pipe_fds[0], F_SETFD, O_NONBLOCK | FD_CLOEXEC) < 0)
|
||||
{
|
||||
ply_save_errno ();
|
||||
close (pipe_fds[0]);
|
||||
close (pipe_fds[1]);
|
||||
ply_restore_errno ();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fcntl (pipe_fds[1], F_SETFD, O_NONBLOCK | FD_CLOEXEC) < 0)
|
||||
{
|
||||
ply_save_errno ();
|
||||
close (pipe_fds[0]);
|
||||
close (pipe_fds[1]);
|
||||
ply_restore_errno ();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue