Ticket #4191: unable to browse tar.xz archives.

Initial commit: revert "(open_error_pipe): fix resource leak."

This reverts commit 61f997de26.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-02-07 15:17:50 +03:00
parent ff0949ece8
commit 68556db80d
1 changed files with 1 additions and 6 deletions

View File

@ -715,14 +715,11 @@ tilde_expand (const char *directory)
void
open_error_pipe (void)
{
int error_fd = -1;
if (pipe (error_pipe) < 0)
message (D_NORMAL, _("Warning"), _("Pipe failed"));
old_error = dup (STDERR_FILENO);
if (old_error < 0 || close (STDERR_FILENO) != 0
|| (error_fd = dup (error_pipe[1])) != STDERR_FILENO)
if (old_error < 0 || close (STDERR_FILENO) != 0 || dup (error_pipe[1]) != STDERR_FILENO)
{
message (D_NORMAL, _("Warning"), _("Dup failed"));
@ -752,8 +749,6 @@ open_error_pipe (void)
}
}
}
if (error_fd >= 0)
close (error_fd);
/* we never write there */
close (error_pipe[1]);
error_pipe[1] = -1;