summaryrefslogtreecommitdiffstats
path: root/auth/cli-editor
diff options
context:
space:
mode:
Diffstat (limited to 'auth/cli-editor')
-rw-r--r--auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java
index 3adea1a89..991257e6b 100644
--- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java
+++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java
@@ -131,8 +131,15 @@ public class CommandLineEditorLoop {
}
}
- reader.close();
- writer.close();
+ writer.flush();
+
+ if (!System.in.equals(inputStream)) {
+ reader.close();
+ }
+
+ if (!System.out.equals(outputStream) && !System.err.equals(outputStream)) {
+ writer.close();
+ }
return executionStatus.getRight();
}