summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 6ddfc74a11..5e9e5c7ace 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -482,7 +482,7 @@ static int php_stdiop_seek(php_stream *stream, off_t offset, int whence, off_t *
static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
{
- int fd;
+ php_socket_t fd;
php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract;
assert(data != NULL);
@@ -506,31 +506,31 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
}
*(FILE**)ret = data->file;
- data->fd = -1;
+ data->fd = SOCK_ERR;
}
return SUCCESS;
case PHP_STREAM_AS_FD_FOR_SELECT:
PHP_STDIOP_GET_FD(fd, data);
- if (fd < 0) {
+ if (SOCK_ERR == fd) {
return FAILURE;
}
if (ret) {
- *(int*)ret = fd;
+ *(php_socket_t *)ret = fd;
}
return SUCCESS;
case PHP_STREAM_AS_FD:
PHP_STDIOP_GET_FD(fd, data);
- if (fd < 0) {
+ if (SOCK_ERR == fd) {
return FAILURE;
}
if (data->file) {
fflush(data->file);
}
if (ret) {
- *(int*)ret = fd;
+ *(php_socket_t *)ret = fd;
}
return SUCCESS;
default: