Logo Search packages:      
Sourcecode: condor version File versions  Download package

MyString * DaemonCore::Read_Std_Pipe ( int  pid,
int  std_fd 
)

Gain access to data written to a given DC process's std(out|err) pipe.

Parameters:
pid DC process id of the process to read the data for.
std_fd The fd to identify the pipe to read: 1 for stdout, 2 for stderr.
Returns:
Pointer to a MyString object containing all the data written so far.

Definition at line 1960 of file daemon_core.cpp.

                                             {
      PidEntry *pidinfo = NULL;
      if ((pidTable->lookup(pid, pidinfo) < 0)) {
                  // we have no information on this pid
                  // TODO-pipe: distinguish this error somehow?
            return NULL;
      }
            // We just want to return a pointer to what we've got so
            // far. If there was no std pipe setup here, this will always
            // be NULL. However, if there was a pipe, but that's now been
            // closed, the std_pipes entry will already be cleared out, so
            // we can't rely on that.
      return pidinfo->pipe_buf[std_fd];
}


Generated by  Doxygen 1.6.0   Back to index