[jenkins] 11/22: purge-winp

James Downing Page jamespage at alioth.debian.org
Tue Aug 13 11:47:02 UTC 2013


This is an automated email from the git hooks/post-receive script.

jamespage pushed a commit to branch patch-queue/master
in repository jenkins.

commit 69da8b4c6e352baf379f78d30e52d9f89f38239c
Author: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Date:   Sun Aug 11 10:41:39 2013 +0100

    purge-winp
    
    
    Gbp-Pq-Topic: native-integration
---
 core/src/main/java/hudson/util/ProcessTree.java |   81 -----------------------
 1 file changed, 81 deletions(-)

diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java
index 392e73c..da06757 100644
--- a/core/src/main/java/hudson/util/ProcessTree.java
+++ b/core/src/main/java/hudson/util/ProcessTree.java
@@ -37,8 +37,6 @@ import hudson.util.ProcessTree.OSProcess;
 import hudson.util.ProcessTreeRemoting.IOSProcess;
 import hudson.util.ProcessTreeRemoting.IProcessTree;
 import org.apache.commons.io.FileUtils;
-import org.jvnet.winp.WinProcess;
-import org.jvnet.winp.WinpException;
 
 import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
@@ -331,9 +329,6 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
             return DEFAULT;
 
         try {
-            if(File.pathSeparatorChar==';')
-                return new Windows();
-
             String os = Util.fixNull(System.getProperty("os.name"));
             if(os.equals("Linux"))
                 return new Linux();
@@ -390,82 +385,6 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
         }
     };
 
-
-    private static final class Windows extends Local {
-        Windows() {
-            for (final WinProcess p : WinProcess.all()) {
-                int pid = p.getPid();
-                if(pid == 0 || pid == 4) continue; // skip the System Idle and System processes
-                super.processes.put(pid,new OSProcess(pid) {
-                    private EnvVars env;
-                    private List<String> args;
-
-                    public OSProcess getParent() {
-                        // windows process doesn't have parent/child relationship
-                        return null;
-                    }
-
-                    public void killRecursively() {
-                        LOGGER.finer("Killing recursively "+getPid());
-                        p.killRecursively();
-                    }
-
-                    public void kill() throws InterruptedException {
-                        LOGGER.finer("Killing "+getPid());
-                        p.kill();
-                        killByKiller();
-                    }
-
-                    @Override
-                    public synchronized List<String> getArguments() {
-                        if(args==null)  args = Arrays.asList(QuotedStringTokenizer.tokenize(p.getCommandLine()));
-                        return args;
-                    }
-
-                    @Override
-                    public synchronized EnvVars getEnvironmentVariables() {
-                        if(env==null)   env = new EnvVars(p.getEnvironmentVariables());
-                        return env;
-                    }
-                });
-
-            }
-        }
-
-        @Override
-        public OSProcess get(Process proc) {
-            return get(new WinProcess(proc).getPid());
-        }
-
-        public void killAll(Map<String, String> modelEnvVars) throws InterruptedException {
-            for( OSProcess p : this) {
-                if(p.getPid()<10)
-                    continue;   // ignore system processes like "idle process"
-
-                LOGGER.finest("Considering to kill "+p.getPid());
-
-                boolean matched;
-                try {
-                    matched = p.hasMatchingEnvVars(modelEnvVars);
-                } catch (WinpException e) {
-                    // likely a missing privilege
-                    LOGGER.log(FINEST,"  Failed to check environment variable match",e);
-                    continue;
-                }
-
-                if(matched)
-                    p.killRecursively();
-                else
-                    LOGGER.finest("Environment variable didn't match");
-
-            }
-        }
-
-        static {
-            WinProcess.enableDebugPrivilege();
-        }
-    }
-
     static abstract class Unix extends Local {
         @Override
         public OSProcess get(Process proc) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jenkins.git



More information about the pkg-java-commits mailing list