CMS 3D CMS Logo

Public Member Functions

evf::FileDescriptorHandler Class Reference

#include <FileDescriptorHandler.h>

List of all members.

Public Member Functions

 FileDescriptorHandler ()

Detailed Description

Definition at line 5 of file FileDescriptorHandler.h.


Constructor & Destructor Documentation

data refman pasoursint CMSSW_4_4_3_patch1 src EventFilter Processor src FileDescriptorHandler cc evf::FileDescriptorHandler::FileDescriptorHandler ( )

Definition at line 18 of file FileDescriptorHandler.cc.

                               {
    char *name = de->d_name;    
    std::string path = ost.str()+name;
    stat(path.c_str(),&buf);
    if(S_ISSOCK(buf.st_mode)){
      int fd = atoi(name);
      oldfds.push_back(fd);
      int newfd = dup(fd);
      if(newfd>0) newfds.push_back(newfd);
      else std::cout <<"couldn't duplicate old fd " << fd << std::endl;
    }
  }
  closedir(dir);
  for(unsigned int i = 0; i < oldfds.size(); i++){
    close(oldfds[i]);
    int newfd = dup2(newfds[i],oldfds[i]);
    if(newfd!=oldfds[i]) std::cout <<"couldn't duplicate new fd to old " 
                                   << oldfds[i] << std::endl;
    close(newfds[i]);
  }
}