jani            Thu Jun  4 11:51:10 2009 UTC

  Modified files:              
    /php-src/sapi/cgi   cgi_main.c 
  Log:
  - 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.382&r2=1.383&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.382 php-src/sapi/cgi/cgi_main.c:1.383
--- php-src/sapi/cgi/cgi_main.c:1.382   Thu Jun  4 11:47:51 2009
+++ php-src/sapi/cgi/cgi_main.c Thu Jun  4 11:51:10 2009
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.382 2009/06/04 11:47:51 jani Exp $ */
+/* $Id: cgi_main.c,v 1.383 2009/06/04 11:51:10 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