jani Thu Jun 4 11:53:38 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/cgi cgi_main.c Log: MFH:- Fixed bug #48419 (non-portable STDIN fileno in cgi_main.c) # This doesn't really fix it since it's some weird Windows thing but this # does make this code slightly more portable :) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.69&r2=1.267.2.15.2.70&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.69 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.70 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.69 Mon Jan 19 18:17:59 2009 +++ php-src/sapi/cgi/cgi_main.c Thu Jun 4 11:53:38 2009 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.69 2009/01/19 18:17:59 dsp Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.70 2009/06/04 11:53:38 jani Exp $ */ #include "php.h" #include "php_globals.h" @@ -461,6 +461,9 @@ 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) { @@ -473,10 +476,10 @@ 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); } #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); #endif if (tmp_read_bytes <= 0) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php