From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/2] test: Rename propagating signal handler
Date: Wed, 6 Nov 2024 14:03:21 +1100 [thread overview]
Message-ID: <20241106030322.2132051-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20241106030322.2132051-1-david@gibson.dropbear.id.au>
nstool in "exec" mode will propagate some signals (specifically SIGTERM) to
the process in the namespace it executes. The signal handler which
accomplishes this is called simply sig_handler(). However, it turns out
we're going to need some other signal handlers, so rename this to the more
specific sig_propagate().
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
test/nstool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/nstool.c b/test/nstool.c
index fc357d8..3f75edd 100644
--- a/test/nstool.c
+++ b/test/nstool.c
@@ -346,7 +346,7 @@ static int openns(const char *fmt, ...)
}
static pid_t sig_pid;
-static void sig_handler(int signum)
+static void sig_propagate(int signum)
{
int err;
@@ -358,7 +358,7 @@ static void sig_handler(int signum)
static void wait_for_child(pid_t pid)
{
struct sigaction sa = {
- .sa_handler = sig_handler,
+ .sa_handler = sig_propagate,
.sa_flags = SA_RESETHAND,
};
int status, err;
--
@@ -346,7 +346,7 @@ static int openns(const char *fmt, ...)
}
static pid_t sig_pid;
-static void sig_handler(int signum)
+static void sig_propagate(int signum)
{
int err;
@@ -358,7 +358,7 @@ static void sig_handler(int signum)
static void wait_for_child(pid_t pid)
{
struct sigaction sa = {
- .sa_handler = sig_handler,
+ .sa_handler = sig_propagate,
.sa_flags = SA_RESETHAND,
};
int status, err;
--
2.47.0
next prev parent reply other threads:[~2024-11-06 3:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 3:03 [PATCH 0/2] Small fixes for nstool David Gibson
2024-11-06 3:03 ` David Gibson [this message]
2024-11-06 3:03 ` [PATCH 2/2] test: Make nstool hold robust against interruptions to control clients David Gibson
2024-11-07 14:54 ` [PATCH 0/2] Small fixes for nstool Stefano Brivio
2024-11-07 23:30 ` David Gibson
2024-11-08 0:05 ` Stefano Brivio
2024-11-08 2:32 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106030322.2132051-2-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).