diff options
author | Brad King <brad.king@kitware.com> | 2006-03-08 17:12:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-03-08 17:12:37 (GMT) |
commit | 17d79233ff8693d1c10c1d28baea0b62b75c34af (patch) | |
tree | d1ff7a44957d757c2a648f43d3f5ce312dff667c /Source/kwsys/ProcessUNIX.c | |
parent | c31c18bb9c4b8bcfb88c52abd2e39869aff815f3 (diff) | |
download | CMake-17d79233ff8693d1c10c1d28baea0b62b75c34af.zip CMake-17d79233ff8693d1c10c1d28baea0b62b75c34af.tar.gz CMake-17d79233ff8693d1c10c1d28baea0b62b75c34af.tar.bz2 |
ENH: Enabled process tree killing on HP-UX.
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 942325c..e343bfe 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -1906,12 +1906,10 @@ static pid_t kwsysProcessFork(kwsysProcess* cp, pid and then the ppid. */ #if defined(__linux__) || defined(__APPLE__) # define KWSYSPE_PS_COMMAND "ps axo pid,ppid" -# define KWSYSPE_PS_HEADER "%*s %*s\n" # define KWSYSPE_PS_FORMAT "%d %d\n" -#elif defined(__hpux) && 0 /* Disable until tested. */ +#elif defined(__hpux) # define KWSYSPE_PS_COMMAND "ps -ef" -# define KWSYSPE_PS_HEADER "%*s %*s %*s %*s %*s %*s %*s %*s\n" -# define KWSYSPE_PS_FORMAT "%*s %d %d %*s %*s %*s %*s %*s\n" +# define KWSYSPE_PS_FORMAT "%*s %d %d %*[^\n]\n" #endif /*--------------------------------------------------------------------------*/ @@ -1985,7 +1983,7 @@ static void kwsysProcessKill(pid_t process_id) FILE* ps = popen(KWSYSPE_PS_COMMAND, "r"); /* Make sure the process started and provided a valid header. */ - if(ps && fscanf(ps, KWSYSPE_PS_HEADER) != EOF) + if(ps && fscanf(ps, "%*[^\n]\n") != EOF) { /* Look for processes whose parent is the process being killed. */ int pid, ppid; |