mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
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:
parent
ff0949ece8
commit
68556db80d
@ -715,14 +715,11 @@ tilde_expand (const char *directory)
|
|||||||
void
|
void
|
||||||
open_error_pipe (void)
|
open_error_pipe (void)
|
||||||
{
|
{
|
||||||
int error_fd = -1;
|
|
||||||
|
|
||||||
if (pipe (error_pipe) < 0)
|
if (pipe (error_pipe) < 0)
|
||||||
message (D_NORMAL, _("Warning"), _("Pipe failed"));
|
message (D_NORMAL, _("Warning"), _("Pipe failed"));
|
||||||
|
|
||||||
old_error = dup (STDERR_FILENO);
|
old_error = dup (STDERR_FILENO);
|
||||||
if (old_error < 0 || close (STDERR_FILENO) != 0
|
if (old_error < 0 || close (STDERR_FILENO) != 0 || dup (error_pipe[1]) != STDERR_FILENO)
|
||||||
|| (error_fd = dup (error_pipe[1])) != STDERR_FILENO)
|
|
||||||
{
|
{
|
||||||
message (D_NORMAL, _("Warning"), _("Dup failed"));
|
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 */
|
/* we never write there */
|
||||||
close (error_pipe[1]);
|
close (error_pipe[1]);
|
||||||
error_pipe[1] = -1;
|
error_pipe[1] = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user