From: Reeze Xia Date: Tue, 26 May 2015 14:04:50 +0000 (+0800) Subject: Fixed phpdbg exit unexpected after signal SIGCONT on OS X X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~30^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca31711625095c2d6e308d7f0fc9d371ad0934d4;p=php Fixed phpdbg exit unexpected after signal SIGCONT on OS X --- diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index 1f004fbae1..58ea06e299 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -178,11 +178,19 @@ PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len) { PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { + int ret; + if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { return phpdbg_consume_bytes(sock, ptr, len, tmo); } - return read(sock, ptr, len); + ret = read(sock, ptr, len); + if (ret == (size_t)-1 && errno == EINTR) { + /* Read was interrupted, retry once */ + ret = read(sock, ptr, len); + } + + return ret; }