[lxc-devel] [lxc/master] start: pidfds obviously start - like any fd - at 0

brauner on Github lxc-bot at linuxcontainers.org
Fri Oct 4 08:43:02 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191004/a0226efd/attachment.bin>
-------------- next part --------------
From d1687497fb8105c88bb1e53a0a3f26af67dceed7 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Fri, 4 Oct 2019 10:31:41 +0200
Subject: [PATCH] start: pidfds obviously start - like any fd - at 0

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/start.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index e6544ea19c..32267b773a 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1112,9 +1112,9 @@ void lxc_abort(const char *name, struct lxc_handler *handler)
 
 	lxc_set_state(name, handler, ABORTING);
 
-	if (handler->pidfd > 0)
+	if (handler->pidfd >= 0)
 		ret = lxc_raw_pidfd_send_signal(handler->pidfd, SIGKILL, NULL, 0);
-	else if (handler->proc_pidfd > 0)
+	else if (handler->proc_pidfd >= 0)
 		ret = lxc_raw_pidfd_send_signal(handler->proc_pidfd, SIGKILL, NULL, 0);
 	else if (handler->pid > 0)
 		ret = kill(handler->pid, SIGKILL);


More information about the lxc-devel mailing list