Browse Source

fix bug #39651: proc_open() append mode doesnt work on windows

PHP-5.2.1RC1
Nuno Lopes 19 years ago
parent
commit
b24d4ddac9
  1. 6
      ext/standard/proc_open.c

6
ext/standard/proc_open.c

@ -677,6 +677,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

Loading…
Cancel
Save