Skip to content

Commit

Permalink
attach: fix logging for stdfd replacement
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 1, 2021
1 parent a756343 commit 93b9960
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/attach.c
Expand Up @@ -1134,11 +1134,11 @@ __noreturn static void do_attach(struct attach_payload *ap)

if (options->stdout_fd >= 0 && options->stdout_fd != STDOUT_FILENO)
if (dup2(options->stdout_fd, STDOUT_FILENO))
SYSDEBUG("Failed to replace stdout with %d", options->stdin_fd);
SYSDEBUG("Failed to replace stdout with %d", options->stdout_fd);

if (options->stderr_fd >= 0 && options->stderr_fd != STDERR_FILENO)
if (dup2(options->stderr_fd, STDERR_FILENO))
SYSDEBUG("Failed to replace stderr with %d", options->stdin_fd);
SYSDEBUG("Failed to replace stderr with %d", options->stderr_fd);

/* close the old fds */
if (options->stdin_fd > STDERR_FILENO)
Expand Down

0 comments on commit 93b9960

Please sign in to comment.