Skip to content

Commit 935b5cb

Browse files
committed
Flush stderr on win32 in cli_log_message
This allows us to unfork a bunch of tests for Windows.
1 parent 4877641 commit 935b5cb

10 files changed

+4
-113
lines changed

ext/session/tests/bug66481-win32.phpt

Lines changed: 0 additions & 17 deletions
This file was deleted.

ext/session/tests/bug66481.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Bug #66481: Calls to session_name() segfault when session.name is null.
44
session.name=
55
--SKIPIF--
66
<?php include('skipif.inc'); ?>
7-
<?php if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows"); ?>
87
--FILE--
98
<?php
109

ext/session/tests/rfc1867_invalid_settings-win.phpt

Lines changed: 0 additions & 19 deletions
This file was deleted.

ext/session/tests/rfc1867_invalid_settings.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ error_log=
66
--SKIPIF--
77
<?php
88
include('skipif.inc');
9-
if(substr(PHP_OS, 0, 3) == "WIN")
10-
die("skip Not for Windows");
119
?>
1210
--FILE--
1311
<?php

ext/session/tests/rfc1867_invalid_settings_2-win.phpt

Lines changed: 0 additions & 19 deletions
This file was deleted.

ext/session/tests/rfc1867_invalid_settings_2.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ error_log=
66
--SKIPIF--
77
<?php
88
include('skipif.inc');
9-
if(substr(PHP_OS, 0, 3) == "WIN")
10-
die("skip Not for Windows");
119
?>
1210
--FILE--
1311
<?php

ext/soap/tests/bugs/bug31422-win.phpt

Lines changed: 0 additions & 47 deletions
This file was deleted.

ext/soap/tests/bugs/bug31422.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
Bug #31422 (No Error-Logging on SoapServer-Side)
33
--SKIPIF--
44
<?php
5-
if (substr(PHP_OS, 0, 3) == 'WIN') {
6-
die('skip not valid for windows');
7-
}
85
require_once('skipif.inc');
96
?>
107
--INI--

main/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,11 +1117,9 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
11171117
if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi")) &&
11181118
PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR
11191119
) {
1120-
#ifdef PHP_WIN32
11211120
fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno);
1121+
#ifdef PHP_WIN32
11221122
fflush(stderr);
1123-
#else
1124-
fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno);
11251123
#endif
11261124
} else {
11271125
php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string));

sapi/cli/php_cli.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ static void sapi_cli_register_variables(zval *track_vars_array) /* {{{ */
379379
static void sapi_cli_log_message(char *message) /* {{{ */
380380
{
381381
fprintf(stderr, "%s\n", message);
382+
#ifdef PHP_WIN32
383+
fflush(stderr);
384+
#endif
382385
}
383386
/* }}} */
384387

0 commit comments

Comments
 (0)