[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kdelibs4_snapshot/kdecore
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2006-04-15 13:16:41
Message-ID: 1145107001.975025.27401.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 530123 by ossi:

forwardport MergedStderr and CTtyOnly


 M  +4 -0      kprocess.cpp  
 M  +11 -5     kprocess.h  


--- branches/work/kdelibs4_snapshot/kdecore/kprocess.cpp #530122:530123
@@ -963,6 +963,10 @@
     if (dup2(out[1], STDOUT_FILENO) < 0 ||
         setsockopt(out[1], SOL_SOCKET, SO_LINGER, (char *)&so, sizeof(so)))
       ok = 0;
+    if (communication & MergedStderr) {
+      if (dup2(out[1], STDERR_FILENO) < 0)
+        ok = 0;
+    }
   }
   if (d->usePty & Stderr) {
     if (dup2(d->pty->slaveFd(), STDERR_FILENO) < 0) ok = 0;
--- branches/work/kdelibs4_snapshot/kdecore/kprocess.h #530122:530123
@@ -141,8 +141,15 @@
        Stderr = 4, /**< Connect to read from the process' stderr. */
        AllOutput = 6, /**< Connects to all output channels. */
        All = 7, /**< Connects to all channels. */
-       NoRead /**< If specified with Stdout, no data is actually read from stdout,
-               * only the signal receivedStdout(int fd, int &len) is emitted. */
+       NoRead = 8, /**< If specified with Stdout, no data is actually read from stdout,
+                    * only the signal receivedStdout(int fd, int &len) is emitted. */
+       CTtyOnly = NoRead, /**< Tells setUsePty() to create a PTY for the process
+                           * and make it the process' controlling TTY, but does not
+                           * redirect any I/O channel to the PTY. */
+       MergedStderr = 16, /**< If specified with Stdout, the process' stderr will be
+                           * redirected onto the same file handle as its stdout, i.e.,
+                           * all error output will be signalled with receivedStdout().
+                           * Don't specify Stderr if you specify MergedStderr. */
   };
 
   Q_DECLARE_FLAGS(Communication, CommunicationFlag)
@@ -505,9 +512,8 @@
 
   /**
    * Obtains the pty object used by this process. The return value is
-   * valid only after setUsePty() was used to associate at least one
-   * standard I/O stream to a pty. The pty is open only while the process
-   * is running.
+   * valid only after setUsePty() was used with a non-zero argument.
+   * The pty is open only while the process is running.
    * @return a pointer to the pty object
    */
   KPty *pty() const;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic