From b7d581b412506eb008dd860b278a21c194674d18 Mon Sep 17 00:00:00 2001 From: zzz Date: Thu, 11 Jun 2009 13:22:56 +0000 Subject: [PATCH] Dont try to dump threads unless there is a wrapper and we arent on windows --- router/java/src/net/i2p/router/RouterWatchdog.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/router/java/src/net/i2p/router/RouterWatchdog.java b/router/java/src/net/i2p/router/RouterWatchdog.java index 0ad5a2c41..14dc01c1e 100644 --- a/router/java/src/net/i2p/router/RouterWatchdog.java +++ b/router/java/src/net/i2p/router/RouterWatchdog.java @@ -95,13 +95,15 @@ class RouterWatchdog implements Runnable { _log.error("Memory: " + DataHelper.formatSize(used) + '/' + DataHelper.formatSize(max)); if (_consecutiveErrors == 1) { _log.log(Log.CRIT, "Router appears hung, or there is severe network congestion. Watchdog starts barking!"); - // This might work on linux... + // This works on linux... // It won't on windows, and we can't call i2prouter.bat either, it does something // completely different... - ShellCommand sc = new ShellCommand(); - boolean success = sc.executeSilentAndWaitTimed("./i2prouter dump", 10); - if (success) - _log.log(Log.CRIT, "Threads dumped to wrapper log"); + if (System.getProperty("wrapper.version") != null && !System.getProperty("os.name").startsWith("Win")) { + ShellCommand sc = new ShellCommand(); + boolean success = sc.executeSilentAndWaitTimed("./i2prouter dump", 10); + if (success) + _log.log(Log.CRIT, "Threads dumped to wrapper log"); + } } } }