summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2009-06-04 11:51:43 +0000
committerJani Taskinen <jani@php.net>2009-06-04 11:51:43 +0000
commita332541aaad20e9554a081b3899f579250676060 (patch)
treedba94f99a1f9aee621a0e34071ae8a62454094ad /sapi
parent29c0b397ecc112d8319bb88a0250ad16ca4b4ef5 (diff)
downloadphp-git-a332541aaad20e9554a081b3899f579250676060.tar.gz
MFH:- Fixed bug #48419 (non-portable STDIN fileno in cgi_main.c)
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cgi/cgi_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index e636a1f9f1..61a4e4b4ae 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -481,6 +481,9 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
@@ -493,7 +496,7 @@ static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
fcgi_request *request = (fcgi_request*) SG(server_context);
tmp_read_bytes = fcgi_read(request, buffer + read_bytes, count_bytes - read_bytes);
} else {
- tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes);
+ tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, count_bytes - read_bytes);
}
if (tmp_read_bytes <= 0) {
break;