From: Junio C Hamano <gitster@pobox.com>
To: Siddh Raman Pant <siddh.raman.pant@oracle.com>,
Johannes Sixt <j6t@kdbg.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Kristoffer Haugsbakk <code@khaugsbakk.name>,
Elijah Newren <newren@gmail.com>, Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH] compat/mingw: Allow SIGKILL to kill in mingw_kill.
Date: Fri, 22 May 2026 15:32:52 +0900 [thread overview]
Message-ID: <xmqqwlwwt0mj.fsf@gitster.g> (raw)
In-Reply-To: <20260522061652.50078-1-siddh.raman.pant@oracle.com> (Siddh Raman Pant's message of "Fri, 22 May 2026 11:46:52 +0530")
Siddh Raman Pant <siddh.raman.pant@oracle.com> writes:
> mingw_kill() only allows SIGTERM for killing a process.
>
> Let's also allow the natural SIGKILL for the same so that callers don't
> have to do ifdef soup for special Windows handling.
>
> Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
> ---
> compat/mingw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
I do not do windows, so I'd like to ask those much more clueful than
I am to see if they see any downsides.
The current code only handles TERM (to terminate) or 0 (to probe)
and everything else results in EINVAL, so the updated behaviour is
to pretend as if TERM is sent and do whatever PROCESS_TERMINATE
does, instead of doing nothing and erroring with EINVAL. Which does
sound like an improvement over the status quo.
What I am wondering is if there are different kind of "kill" in the
Windows land, just like there are distinction between TERM and KILL.
For example, the program ought to be able to block TERM but not
KILL. There are other termination-inducing signals like SIGQUIT but
until we start using them in our code, this emulation layer does not
have to know about them, I think.
Thanks.
> diff --git a/compat/mingw.c b/compat/mingw.c
> index aa7525f419cb..00a994aa9f47 100644
> --- a/compat/mingw.c
> +++ b/compat/mingw.c
> @@ -2250,7 +2250,7 @@ int mingw_execvp(const char *cmd, char *const *argv)
>
> int mingw_kill(pid_t pid, int sig)
> {
> - if (pid > 0 && sig == SIGTERM) {
> + if (pid > 0 && (sig == SIGTERM || sig == SIGKILL)) {
> HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
>
> if (TerminateProcess(h, -1)) {
next prev parent reply other threads:[~2026-05-22 6:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 6:16 [PATCH] compat/mingw: Allow SIGKILL to kill in mingw_kill Siddh Raman Pant
2026-05-22 6:32 ` Junio C Hamano [this message]
2026-05-22 8:03 ` Siddh Raman Pant
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=xmqqwlwwt0mj.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=newren@gmail.com \
--cc=ps@pks.im \
--cc=siddh.raman.pant@oracle.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox