From d614445dd8f03d3b0fcf12ef9fbf11f1884a2aed Mon Sep 17 00:00:00 2001 From: guodong Date: Sun, 5 Jun 2022 23:57:36 +0800 Subject: [PATCH] [1.1] libct/nsenter: switch to sane_kill() Signed-off-by: guodong --- libcontainer/nsenter/nsexec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcontainer/nsenter/nsexec.c b/libcontainer/nsenter/nsexec.c index 52e4521c523..9ecf791e93f 100644 --- a/libcontainer/nsenter/nsexec.c +++ b/libcontainer/nsenter/nsexec.c @@ -1068,7 +1068,7 @@ void nsexec(void) s = SYNC_MOUNTSOURCES_ACK; if (write(syncfd, &s, sizeof(s)) != sizeof(s)) { - kill(stage1_pid, SIGKILL); + sane_kill(stage1_pid, SIGKILL); bail("failed to sync with child: write(SYNC_MOUNTSOURCES_ACK)"); } break; @@ -1230,7 +1230,7 @@ void nsexec(void) if (config.mountsources) { s = SYNC_MOUNTSOURCES_PLS; if (write(syncfd, &s, sizeof(s)) != sizeof(s)) { - kill(stage2_pid, SIGKILL); + sane_kill(stage2_pid, SIGKILL); bail("failed to sync with parent: write(SYNC_MOUNTSOURCES_PLS)"); } @@ -1239,11 +1239,11 @@ void nsexec(void) /* Parent finished to send the mount sources fds. */ if (read(syncfd, &s, sizeof(s)) != sizeof(s)) { - kill(stage2_pid, SIGKILL); + sane_kill(stage2_pid, SIGKILL); bail("failed to sync with parent: read(SYNC_MOUNTSOURCES_ACK)"); } if (s != SYNC_MOUNTSOURCES_ACK) { - kill(stage2_pid, SIGKILL); + sane_kill(stage2_pid, SIGKILL); bail("failed to sync with parent: SYNC_MOUNTSOURCES_ACK: got %u", s); } }