nlopess         Wed Sep 12 11:46:08 2007 UTC

  Modified files:              
    /php-src/ext/standard       proc_open.c 
  Log:
  MFB: fix #39651
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.58&r2=1.59&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.58 
php-src/ext/standard/proc_open.c:1.59
--- php-src/ext/standard/proc_open.c:1.58       Fri Aug 17 10:42:12 2007
+++ php-src/ext/standard/proc_open.c    Wed Sep 12 11:46:08 2007
@@ -15,7 +15,7 @@
    | Author: Wez Furlong <[EMAIL PROTECTED]>                           |
    +----------------------------------------------------------------------+
  */
-/* $Id: proc_open.c,v 1.58 2007/08/17 10:42:12 jani Exp $ */
+/* $Id: proc_open.c,v 1.59 2007/09/12 11:46:08 nlopess Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE           /* linux wants this when XOPEN mode is on */
@@ -669,6 +669,12 @@
 #ifdef PHP_WIN32
                                descriptors[ndesc].childend = 
dup_fd_as_handle(fd);
                                _close(fd);
+
+                               /* simulate the append mode by fseeking to the 
end of the file
+                               this introduces a potential race-condition, but 
it is the best we can do, though */
+                               if (strchr(Z_STRVAL_PP(zmode), 'a')) {
+                                       
SetFilePointer(descriptors[ndesc].childend, 0, NULL, FILE_END);
+                               }
 #else
                                descriptors[ndesc].childend = fd;
 #endif

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

Reply via email to