com php-src: windows fixes: phpdbg.c phpdbg_cmd.c
| From: | Bob Weinand | Date: | Thu, 28 Nov 2013 17:30:27 +0000 |
| Subject: | com php-src: windows fixes: phpdbg.c phpdbg_cmd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74555@lists.php.net to get a copy of this message | ||
Commit: c464b011de5aceef9005da8bba4b687d1e5d4a1f
Author: krakjoe <joe.watkins@live.co.uk> Thu, 28 Nov 2013 17:30:27 +0000
Parents: 022c621f96c9fa6e45242ef541becf35ce06ded1
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c464b011de5aceef9005da8bba4b687d1e5d4a1f
Log:
windows fixes
Changed paths:
M phpdbg.c
M phpdbg_cmd.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index 39963a5..1b3f227 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 916c9d7..037e6df 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))) ||