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

char * DaemonCore::InfoCommandSinfulString ( int  pid = -1  ) 

Returns the Sinful String <host:port> of the DaemonCore command socket of this process as a default. If given a pid, it returns the sinful string of that pid.

Parameters:
pid The pid to ask about. -1 (Default) means the calling process
Returns:
A pointer into a static buffer, or NULL on error

Definition at line 911 of file daemon_core.cpp.

References InfoCommandSinfulStringMyself().

Referenced by BaseShadow::baseInit(), Create_Thread(), JobQueueDBManager::createQuillAd(), ParallelShadow::getResources(), MPIShadow::getResources(), JICShadow::publishStarterInfo(), JICShadow::registerStarterInfo(), and JobInfoCommunicator::writeExecutionVisa().

{
      static char somepid_sinful_string[28];

      // if pid is -1, we want info on our own process, else we want info
      // on a process created with Create_Process().
      if ( pid == -1 ) {
            return InfoCommandSinfulStringMyself(false);
      } else {
            PidEntry *pidinfo = NULL;
            if ((pidTable->lookup(pid, pidinfo) < 0)) {
                  // we have no information on this pid
                  return NULL;
            }
            if ( pidinfo->sinful_string[0] == '\0' ) {
                  // this pid is apparently not a daemon core process
                  return NULL;
            }
            strncpy(somepid_sinful_string,pidinfo->sinful_string,
                  sizeof(somepid_sinful_string) );
            somepid_sinful_string[sizeof(somepid_sinful_string)-1] = 0; // Stupid strncpy
            return somepid_sinful_string;
      }
}


Generated by  Doxygen 1.6.0   Back to index