felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1736010 - in /felix/trunk/gogo/runtime/src/main/java/org/apache/felix: gogo/runtime/CommandSessionImpl.java gogo/runtime/Pipe.java service/command/CommandSession.java
Date Mon, 21 Mar 2016 16:54:42 GMT
Author: gnodet
Date: Mon Mar 21 16:54:42 2016
New Revision: 1736010

URL: http://svn.apache.org/viewvc?rev=1736010&view=rev
Log:
Add isTty and error to access pipes from the public api

Modified:
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Pipe.java
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/CommandSession.java

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java?rev=1736010&r1=1736009&r2=1736010&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
(original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
Mon Mar 21 16:54:42 2016
@@ -742,4 +742,14 @@ public class CommandSessionImpl implemen
         }
 
     }
+
+    @Override
+    public boolean isTty(int fd) {
+        return Pipe.isTty(fd);
+    }
+
+    @Override
+    public void error(int error) {
+        Pipe.error(error);
+    }
 }

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Pipe.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Pipe.java?rev=1736010&r1=1736009&r2=1736010&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Pipe.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Pipe.java Mon Mar
21 16:54:42 2016
@@ -81,6 +81,11 @@ public class Pipe implements Callable<Re
         return CURRENT.get();
     }
 
+    public static boolean isTty(int fd) {
+        Pipe current = getCurrentPipe();
+        return current != null && !current.toclose[fd];
+    }
+
     public static void error(int error) {
         Pipe current = getCurrentPipe();
         if (current != null) {

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/CommandSession.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/CommandSession.java?rev=1736010&r1=1736009&r2=1736010&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/CommandSession.java
(original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/CommandSession.java
Mon Mar 21 16:54:42 2016
@@ -127,4 +127,18 @@ public interface CommandSession
      */
     void setJobListener(JobListener listener);
 
+    //
+    // Process access
+    //
+
+    /**
+     * Check if the given descriptor for the currently running pipe is the terminal or not.
+     */
+    boolean isTty(int fd);
+
+    /**
+     * Set the error code for the currently running pipe.
+     */
+    void error(int error);
+
 }



Mime
View raw message