From 4b4ecf5f226a9222003a115505fe0eb1e8edfc82 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Mon, 24 Sep 2007 19:13:20 +0000
Subject: [PATCH] Fixed a issue where executing an external process using the StaticUtils.exec method might never return. This will cause the server to dead lock when setting the file permissions using the UNIX chmod command. A particular case where this may happen is during log rotation on Java 5.
---
opends/src/server/org/opends/server/util/StaticUtils.java | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/StaticUtils.java b/opends/src/server/org/opends/server/util/StaticUtils.java
index 1ddfee9..6f771db 100644
--- a/opends/src/server/org/opends/server/util/StaticUtils.java
+++ b/opends/src/server/org/opends/server/util/StaticUtils.java
@@ -38,6 +38,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.text.ParseException;
@@ -2388,13 +2389,14 @@
}
else
{
+ InputStream processStream = process.getInputStream();
BufferedReader reader =
new BufferedReader(new InputStreamReader(
process.getInputStream()));
try
{
- while (true)
+ while (processStream.available() > 0)
{
String line = reader.readLine();
if (line == null)
--
Gitblit v1.10.0