public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 1/4] Use 'kill -W' when killing processes
Date: Thu, 21 Mar 2019 15:35:00 -0000	[thread overview]
Message-ID: <20190321153508.8898-2-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20190321153508.8898-1-jon.turney@dronecode.org.uk>

We only have access to the Windows PID, which (since Cygwin 3.0.0) are
completely decoupled from Cygwin PIDs.

Use the new '-W' flag to indicate to kill that we are providing a
Windows PID.

(If the Cygwin install is too old to support kill -W, kill will fail,
and we'll fall back to using TerminateProcess())

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
 processlist.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/processlist.cc b/processlist.cc
index 70bc2d7..4e8518a 100644
--- a/processlist.cc
+++ b/processlist.cc
@@ -91,7 +91,7 @@ Process::kill (int force)
         break;
      }
 
-  std::string kill_cmd = backslash (cygpath ("/bin/kill.exe")) + " " + signame + " " + stringify (processID);
+  std::string kill_cmd = backslash (cygpath ("/bin/kill.exe")) + " " + signame + " -W " + stringify (processID);
   ::run (kill_cmd.c_str ());
 }
 
-- 
2.17.0

  parent reply	other threads:[~2019-03-21 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 15:35 [PATCH setup 0/4] setup fixes Jon Turney
2019-03-21 15:35 ` [PATCH setup 2/4] Don't show FTP 550 'file not found' errors in a MessageBox Jon Turney
2019-03-21 15:35 ` Jon Turney [this message]
2019-03-21 15:36 ` [PATCH setup 4/4] Add double-click for a 'default action' to ListView Jon Turney
2019-03-21 15:36 ` [PATCH setup 3/4] Don't propagate actions down category tree into obsolete categories Jon Turney

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=20190321153508.8898-2-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).