com php-src: bail on fail for console input, fix - ./phpdbg: phpdbg_cmd.c

From: Date: Tue, 19 Nov 2013 13:11:45 +0000
Subject: com php-src: bail on fail for console input, fix - ./phpdbg: phpdbg_cmd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74804@lists.php.net to get a copy of this message
Commit: cf4b451d39f936689fdf51cac6d8847147a1edd5 Author: krakjoe <joe.watkins@live.co.uk> Tue, 19 Nov 2013 13:11:45 +0000 Parents: 73e7f5c645ef54a169eb845f26ad242490ea0c2e Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cf4b451d39f936689fdf51cac6d8847147a1edd5 Log: bail on fail for console input, fix - ./phpdbg Changed paths: M phpdbg_cmd.c Diff: diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index 41dead1..b097223 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -129,6 +129,10 @@ phpdbg_input_t* phpdbg_read_input(TSRMLS_D) /* {{{ */ char buf[PHPDBG_MAX_CMD]; if (!phpdbg_write(PROMPT) || !fgets(buf, PHPDBG_MAX_CMD, stdin)) { + /* the user has gone away */ + phpdbg_error("Failed to read console !"); + PHPDBG_G(flags) |= PHPDBG_IS_QUITTING; + zend_bailout(); return NULL; } @@ -136,6 +140,10 @@ phpdbg_input_t* phpdbg_read_input(TSRMLS_D) /* {{{ */ #else char *cmd = readline(PROMPT); if (!cmd) { + /* the user has gone away */ + phpdbg_error("Failed to read console !"); + PHPDBG_G(flags) |= PHPDBG_IS_QUITTING; + zend_bailout(); return NULL; }

« previous php.cvs (#74804) next »