summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-06 13:54:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-11-06 13:55:35 (GMT)
commit2dabcebf3ce1b331c723055322b3fbe2e8ab482d (patch)
treedbcb3d6834da966b4e6534ce204048606b37efe5 /Source
parent3d6e45af611983d85b130b4f874d862f7d998013 (diff)
parent3048777006e1d10646e7b62f46406859dc4d0812 (diff)
downloadCMake-2dabcebf3ce1b331c723055322b3fbe2e8ab482d.zip
CMake-2dabcebf3ce1b331c723055322b3fbe2e8ab482d.tar.gz
CMake-2dabcebf3ce1b331c723055322b3fbe2e8ab482d.tar.bz2
Merge topic 'update-kwsys'
30487770 Merge branch 'upstream-KWSys' into update-kwsys 5464e23f KWSys 2017-11-02 (54f0901a) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1440
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/Process.h.in8
-rw-r--r--Source/kwsys/ProcessUNIX.c5
-rw-r--r--Source/kwsys/ProcessWin32.c5
3 files changed, 18 insertions, 0 deletions
diff --git a/Source/kwsys/Process.h.in b/Source/kwsys/Process.h.in
index 237001c..6cb9443 100644
--- a/Source/kwsys/Process.h.in
+++ b/Source/kwsys/Process.h.in
@@ -77,6 +77,7 @@
#define kwsysProcess_WaitForExit kwsys_ns(Process_WaitForExit)
#define kwsysProcess_Interrupt kwsys_ns(Process_Interrupt)
#define kwsysProcess_Kill kwsys_ns(Process_Kill)
+#define kwsysProcess_KillPID kwsys_ns(Process_KillPID)
#define kwsysProcess_ResetStartTime kwsys_ns(Process_ResetStartTime)
#endif
@@ -457,6 +458,13 @@ kwsysEXPORT void kwsysProcess_Interrupt(kwsysProcess* cp);
kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp);
/**
+ * Same as kwsysProcess_Kill using process ID to locate process to
+ * terminate.
+ * @see kwsysProcess_Kill(kwsysProcess* cp)
+ */
+kwsysEXPORT void kwsysProcess_KillPID(unsigned long);
+
+/**
* Reset the start time of the child process to the current time.
*/
kwsysEXPORT void kwsysProcess_ResetStartTime(kwsysProcess* cp);
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index e62ef34..718a1aa 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -2485,6 +2485,11 @@ static pid_t kwsysProcessFork(kwsysProcess* cp,
#define KWSYSPE_PS_FORMAT "%d %d %*[^\n]\n"
#endif
+void kwsysProcess_KillPID(unsigned long process_id)
+{
+ kwsysProcessKill((pid_t)process_id);
+}
+
static void kwsysProcessKill(pid_t process_id)
{
#if defined(__linux__) || defined(__CYGWIN__)
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index 945fa28..82fdc74 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -1466,6 +1466,11 @@ void kwsysProcess_Kill(kwsysProcess* cp)
for them to exit. */
}
+void kwsysProcess_KillPID(unsigned long process_id)
+{
+ kwsysProcessKillTree((DWORD)process_id);
+}
+
/*
Function executed for each pipe's thread. Argument is a pointer to
the kwsysProcessPipeData instance for this thread.