com php-src: windows ...: phpdbg.c
| From: | Bob Weinand | Date: | Thu, 28 Nov 2013 18:22:30 +0000 |
| Subject: | com php-src: windows ...: phpdbg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74557@lists.php.net to get a copy of this message | ||
Commit: 55f210c83b91643051bd0f8c73aba5fac106e383
Author: krakjoe <joe.watkins@live.co.uk> Thu, 28 Nov 2013 18:22:30 +0000
Parents: c464b011de5aceef9005da8bba4b687d1e5d4a1f
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=55f210c83b91643051bd0f8c73aba5fac106e383
Log:
windows ...
Changed paths:
M phpdbg.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index 1b3f227...48d618d 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -604,6 +604,7 @@ int phpdbg_open_socket(short port) /* {{{ */
static inline void phpdbg_close_sockets(int (*socket)[2], FILE *streams[2]) /* {{{ */
{
+#ifndef _WIN32
if ((*socket)[0]) {
shutdown((*socket)[0], SHUT_RDWR);
close((*socket)[0]);
@@ -621,6 +622,7 @@ static inline void phpdbg_close_sockets(int (*socket)[2], FILE *streams[2]) /* {
if (streams[1]) {
fclose(streams[1]);
}
+#endif
} /* }}} */
/* don't inline this, want to debug it easily, will inline when done */
@@ -739,6 +741,11 @@ int main(int argc, char **argv) /* {{{ */
streams[1] = NULL;
#ifdef PHP_WIN32
+ {
+ WSADATA WSAData;
+
+ WSAStartup (0x0101, &WSAData);
+ }
_fmode = _O_BINARY; /* sets default for file streams to binary */
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
@@ -886,7 +893,7 @@ phpdbg_main:
(listen[0] > 0 && listen[1] > 0)) {
if (phpdbg_open_sockets(listen, &server, &socket, streams) == FAILURE) {
remote = 0;
- goto phpdbg_out;
+ exit(0);
}
/* set remote flag to stop service shutting down upon quit */
remote = 1;