Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved UserFile casting error back to sock_array_to_fd_set(). #4401

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions hphp/runtime/base/user-file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ int UserFile::fd() const {
Resource handle = const_cast<UserFile*>(this)->invokeCast(
PHP_STREAM_AS_FD_FOR_SELECT);
if (handle.isNull()) {
raise_warning(
"cannot represent a stream of type user-space as a file descriptor"
);
return -1;
}
File *f = handle.getTyped<File>();
Expand Down
3 changes: 3 additions & 0 deletions hphp/runtime/ext/sockets/ext_sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ static void sock_array_to_fd_set(const Array& sockets, pollfd *fds, int &nfds,
File *sock = iter.second().toResource().getTyped<File>();
int intfd = sock->fd();
if (intfd < 0) {
raise_warning(
"cannot represent a stream of type user-space as a file descriptor"
);
continue;
}
pollfd &fd = fds[nfds++];
Expand Down