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

int DaemonCore::Cancel_Signal ( int  sig  ) 

Not_Yet_Documented

Parameters:
sig Not_Yet_Documented
Returns:
Not_Yet_Documented

Definition at line 1158 of file daemon_core.cpp.

{
      int i,j;
      int found = -1;

      // We want to allow "command" to be a negative integer, so
      // be careful about sign when computing our simple hash value
    if(sig < 0) {
        i = -sig % maxSig;
    } else {
        i = sig % maxSig;
    }

      // find this signal in our table
      j = i;
      do {
            if ( (sigTable[j].num == sig) &&
                   ( sigTable[j].handler || sigTable[j].handlercpp ) ) {
                  found = j;
            } else {
                  j = (j + 1) % maxSig;
            }
      } while ( j != i && found == -1 );

      // Check if found
      if ( found == -1 ) {
            dprintf(D_DAEMONCORE,"Cancel_Signal: signal %d not found\n",sig);
            return FALSE;
      }

      // Clear entry
      sigTable[found].num = 0;
      sigTable[found].handler = NULL;
      sigTable[found].handlercpp = (SignalHandlercpp)NULL;
      free_descrip( sigTable[found].handler_descrip );
      sigTable[found].handler_descrip = NULL;

      // Decrement the counter of total number of entries
      nSig--;

      // Clear any data_ptr which go to this entry we just removed
      if ( curr_regdataptr == &(sigTable[found].data_ptr) )
            curr_regdataptr = NULL;
      if ( curr_dataptr == &(sigTable[found].data_ptr) )
            curr_dataptr = NULL;

      // Log a message and conditionally dump what our table now looks like
      dprintf(D_DAEMONCORE,
                              "Cancel_Signal: cancelled signal %d <%s>\n",
                              sig,sigTable[found].sig_descrip);
      free_descrip( sigTable[found].sig_descrip );
      sigTable[found].sig_descrip = NULL;

      DumpSigTable(D_FULLDEBUG | D_DAEMONCORE);

      return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index