@@ -589,11 +589,11 @@ int phpdbg_open_socket(short port) /* {{{ */
589589 return fd ;
590590} /* }}} */
591591
592- int phpdbg_open_sockets (short listen [2 ], FILE * streams [2 ]) /* {{{ */
592+ int phpdbg_open_sockets (int listen [2 ], FILE * streams [2 ]) /* {{{ */
593593{
594594 int sockets [2 ] = {
595- phpdbg_open_socket (listen [0 ]),
596- phpdbg_open_socket (listen [1 ])
595+ phpdbg_open_socket (( short ) listen [0 ]),
596+ phpdbg_open_socket (( short ) listen [1 ])
597597 };
598598 int accepted [2 ] = {-1 , -1 };
599599
@@ -614,11 +614,11 @@ int phpdbg_open_sockets(short listen[2], FILE* streams[2]) /* {{{ */
614614
615615 memset (& address , 0 , size );
616616 accepted [0 ] = accept (
617- sockets [0 ], & address , & size );
617+ sockets [0 ], ( struct sockaddr * ) & address , & size );
618618
619619 memset (& address , 0 , size );
620620 accepted [1 ] = accept (
621- sockets [1 ], & address , & size );
621+ sockets [1 ], ( struct sockaddr * ) & address , & size );
622622 }
623623
624624 streams [0 ] = fdopen (accepted [0 ], "r" );
@@ -648,7 +648,7 @@ int main(int argc, char **argv) /* {{{ */
648648 int run = 0 ;
649649 int step = 0 ;
650650 char * bp_tmp_file ;
651- short listen [2 ];
651+ int listen [2 ];
652652 FILE * streams [2 ] = {NULL , NULL };
653653
654654#ifdef ZTS
@@ -803,7 +803,6 @@ int main(int argc, char **argv) /* {{{ */
803803 if (!cleaning &&
804804 (listen [0 ] && listen [1 ])) {
805805 phpdbg_open_sockets (listen , streams );
806- /* now is a sensible time to announce listen settings on the console */
807806 }
808807
809808 phpdbg -> ini_defaults = phpdbg_ini_defaults ;
@@ -842,6 +841,9 @@ int main(int argc, char **argv) /* {{{ */
842841#endif
843842
844843 PG (modules_activated ) = 0 ;
844+
845+ /* set flags from command line */
846+ PHPDBG_G (flags ) = flags ;
845847
846848 /* setup io here */
847849 if (streams [0 ] && streams [1 ]) {
@@ -850,7 +852,6 @@ int main(int argc, char **argv) /* {{{ */
850852 PHPDBG_G (io )[PHPDBG_STDIN ] = streams [0 ];
851853 PHPDBG_G (io )[PHPDBG_STDOUT ] = streams [1 ];
852854 PHPDBG_G (io )[PHPDBG_STDERR ] = stderr ;
853-
854855 signal (SIGPIPE , SIG_IGN );
855856 } else {
856857 /* local console */
@@ -876,9 +877,6 @@ int main(int argc, char **argv) /* {{{ */
876877 free (oplog_file );
877878 }
878879
879- /* set flags from command line */
880- PHPDBG_G (flags ) = flags ;
881-
882880 /* set default colors */
883881 phpdbg_set_color_ex (PHPDBG_COLOR_PROMPT , PHPDBG_STRL ("white-bold" ) TSRMLS_CC );
884882 phpdbg_set_color_ex (PHPDBG_COLOR_ERROR , PHPDBG_STRL ("red-bold" ) TSRMLS_CC );
0 commit comments