|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-28 23:24 UTC] ed000001 at hotmail dot com
Problem:
Initialization phase (before script) debug mode assertion failure in the Win32 native libraries where "fdopen.c" is implemented when compiling "php4ts_cli" in "Win32 Debug_TS".
Development Environment "Fix":
Do not call dup() for the Win32 platform -- I have not check the implications as this is not my prod environment.
File php_fopen_wrapper.c:
=========================
#ifdef PHP_WIN32
#define FIX_DUP(a) (a)
#else
#define FIX_DUP(a) (dup((a))
#endif
php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
{
FILE * fp = NULL;
php_stream * stream = NULL;
if (!strncasecmp(path, "php://", 6))
path += 6;
if (!strcasecmp(path, "output")) {
return php_stream_alloc(&php_stream_output_ops, NULL, 0, "wb");
}
if (!strcasecmp(path, "input")) {
return php_stream_alloc(&php_stream_input_ops, NULL, 0, "rb");
}
if (!strcasecmp(path, "stdin")) {
fp = fdopen(FIX_DUP(STDIN_FILENO), mode);
} else if (!strcasecmp(path, "stdout")) {
fp = fdopen(FIX_DUP(STDOUT_FILENO), mode);
} else if (!strcasecmp(path, "stderr")) {
fp = fdopen(FIX_DUP(STDERR_FILENO), mode);
}
if (fp) {
stream = php_stream_fopen_from_file(fp, mode);
if (stream == NULL)
fclose(fp);
}
return stream;
}
Thanks for the great tool!
Ed
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jun 17 08:00:02 2026 UTC |
There is an extra "(" in the "(dup((a))" which should be (dup(a))