jani            Thu Jun  4 11:51:43 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/sapi/cgi   cgi_main.c 
  Log:
  MFH:- Fixed bug #48419 (non-portable STDIN fileno in cgi_main.c)
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.50.2.39&r2=1.267.2.15.2.50.2.40&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.50.2.39 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50.2.40
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50.2.39    Thu Jun  4 11:47:27 2009
+++ php-src/sapi/cgi/cgi_main.c Thu Jun  4 11:51:43 2009
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.50.2.39 2009/06/04 11:47:27 jani Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.50.2.40 2009/06/04 11:51:43 jani Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -481,6 +481,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)
 {
@@ -493,7 +496,7 @@
                        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;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to