コード例 #1
0
ファイル: console.cpp プロジェクト: Azzurrio/rubinius
    void Console::setup_files(STATE) {
      request_fd_ = open_file(state, request_path_);
      response_fd_ = open_file(state, response_path_);

      FSEvent* fsevent = FSEvent::create(state);
      fsevent->watch_file(state, request_fd_, request_path_.c_str());
      fsevent_.set(fsevent);
    }
コード例 #2
0
ファイル: console.cpp プロジェクト: JesseChavez/rubinius
    void Request::initialize(STATE) {
      if((fd_ = open_file(state, console_->request_path())) < 0) {
        logger::error("%s: console request: unable to open file", strerror(errno));
        return;
      }

      FSEvent* fsevent = FSEvent::create(state);
      fsevent->watch_file(state, fd_, console_->request_path().c_str());
      fsevent_.set(fsevent);

      enabled_ = true;
    }
コード例 #3
0
ファイル: console.cpp プロジェクト: JesseChavez/rubinius
    void Listener::initialize(STATE) {
      fd_ = ::open(console_->console_path().c_str(),
          O_CREAT | O_TRUNC | O_RDWR | O_CLOEXEC,
          state->shared().config.system_console_access.value);

      if(fd_ < 0) {
        logger::error("%s: unable to open Console connection file",
            strerror(errno));
      }

      // The umask setting will override our permissions for open().
      if(chmod(console_->console_path().c_str(),
            state->shared().config.system_console_access.value) < 0) {
        logger::error("%s: unable to set mode for Console connection file",
            strerror(errno));
      }

      FSEvent* fsevent = FSEvent::create(state);
      fsevent->watch_file(state, fd_, console_->console_path().c_str());
      fsevent_.set(fsevent);
    }
コード例 #4
0
ファイル: fsevent.cpp プロジェクト: Locke23rus/rubinius
 FSEvent* FSEvent::allocate(STATE, Object* self) {
   FSEvent* fsevent = create(state);
   fsevent->klass(state, as<Class>(self));
   return fsevent;
 }