From: Nuno Lopes Date: Wed, 12 Sep 2007 11:46:08 +0000 (+0000) Subject: MFB: fix #39651 X-Git-Tag: RELEASE_2_0_0a1~1829 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08e3aa71a4da40ff685a4520611f1a3eb9b00b16;p=php MFB: fix #39651 --- diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index af72b3bc21..c1c7338011 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -669,6 +669,12 @@ PHP_FUNCTION(proc_open) #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