The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3275

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 92bdc5937e30f3cbee2e7076fb6364a3ff554b41 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Thu, 5 Mar 2020 11:14:24 +0100
Subject: [PATCH] utils: only move_fd() when fdopen() has been successful

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 406a54c0aa..8397d54aef 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -1724,9 +1724,10 @@ static int process_dead(/* takes */ int status_fd)
                return -1;
 
        /* transfer ownership of fd */
-       f = fdopen(move_fd(dupfd), "re");
+       f = fdopen(dupfd, "re");
        if (!f)
                return -1;
+       move_fd(dupfd);
 
        ret = 0;
        while (getline(&line, &n, f) != -1) {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to