diff --git a/folly/io/async/AsyncPipe.cpp b/folly/io/async/AsyncPipe.cpp index e9febc0d7e7deab3ffc3c4a874b560d1541fbfc0..161e6793902d02bd806a9222464dc5dcb9de7fb8 100644 --- a/folly/io/async/AsyncPipe.cpp +++ b/folly/io/async/AsyncPipe.cpp @@ -43,7 +43,7 @@ void AsyncPipeReader::failRead(const AsyncSocketException& ex) { void AsyncPipeReader::close() { unregisterHandler(); if (fd_ >= 0) { - changeHandlerFD(folly::NetworkSocket::fromFd(-1)); + changeHandlerFD(NetworkSocket()); if (closeCb_) { closeCb_(fd_); @@ -192,7 +192,7 @@ void AsyncPipeWriter::closeNow() { } if (fd_ >= 0) { unregisterHandler(); - changeHandlerFD(folly::NetworkSocket::fromFd(-1)); + changeHandlerFD(NetworkSocket()); if (closeCb_) { closeCb_(fd_); } else { diff --git a/folly/io/async/AsyncSocket.cpp b/folly/io/async/AsyncSocket.cpp index 0fcd98c713da19105b0d6c1576deef41553c98a6..86df63672544a5ca375ff0915fa25a331c032af8 100644 --- a/folly/io/async/AsyncSocket.cpp +++ b/folly/io/async/AsyncSocket.cpp @@ -394,7 +394,7 @@ int AsyncSocket::detachFd() { closeNow(); // Update the EventHandler to stop using this fd. // This can only be done after closeNow() unregisters the handler. - ioHandler_.changeHandlerFD(folly::NetworkSocket::fromFd(-1)); + ioHandler_.changeHandlerFD(NetworkSocket()); return fd.toFd(); } diff --git a/folly/io/async/EventHandler.h b/folly/io/async/EventHandler.h index a3f071e766c5396b8676181497be86ba130838ea..b8b47e673333d0fcf10a862a5a4a9e7320ad386b 100644 --- a/folly/io/async/EventHandler.h +++ b/folly/io/async/EventHandler.h @@ -140,10 +140,6 @@ class EventHandler : private boost::noncopyable { * * This may only be called when the handler is not currently registered. */ - void changeHandlerFD(int fd) { - changeHandlerFD(NetworkSocket::fromFd(fd)); - } - void changeHandlerFD(NetworkSocket fd); /**