From: krakjoe Date: Thu, 28 Nov 2013 17:30:27 +0000 (+0000) Subject: windows fixes X-Git-Tag: php-5.6.0alpha1~110^2~30^2~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c464b011de5aceef9005da8bba4b687d1e5d4a1f;p=php windows fixes --- diff --git a/phpdbg.c b/phpdbg.c index 39963a5698..1b3f227a7b 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -557,9 +557,17 @@ int phpdbg_open_socket(short port) /* {{{ */ return -1; default: { +#ifndef _WIN32 int boolean = 1; - - switch (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &boolean, sizeof(int))) { +#else + const char *boolean = "1"; +#endif + +#ifndef _WIN32 + switch (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &boolean, sizeof(boolean))) { +#else + switch (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, boolean, sizeof(boolean))) { +#endif case -1: close(fd); return -2; diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index 916c9d7f62..037e6dfd63 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -218,12 +218,12 @@ PHPDBG_API phpdbg_input_t *phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */ char *cmd = NULL; if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) { - if (buffered == NULL) { + if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && + (buffered == NULL)) { + fflush(PHPDBG_G(io)[PHPDBG_STDOUT]); + } - if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) { - fflush(PHPDBG_G(io)[PHPDBG_STDOUT]); - } - + if (buffered == NULL) { #ifndef HAVE_LIBREADLINE char buf[PHPDBG_MAX_CMD]; if ((!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && !phpdbg_write(phpdbg_get_prompt(TSRMLS_C))) ||