#include <FileDescriptorHandler.h>
Public Member Functions | |
FileDescriptorHandler () |
Definition at line 5 of file FileDescriptorHandler.h.
data doxygen doxygen gen CMSSW_4_2_8 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]); } }