diff options
author | Reeze Xia <reeze@php.net> | 2015-05-26 22:04:50 +0800 |
---|---|---|
committer | Reeze Xia <reeze@php.net> | 2015-05-26 22:04:50 +0800 |
commit | ca31711625095c2d6e308d7f0fc9d371ad0934d4 (patch) | |
tree | 54bf4224328d9a6b1481747e082c0f9e7b321eee /sapi/phpdbg/phpdbg_io.c | |
parent | 4faf7476f9e6a6c57a3bf6bccf0752b33b7cf4b1 (diff) | |
download | php-git-ca31711625095c2d6e308d7f0fc9d371ad0934d4.tar.gz |
Fixed phpdbg exit unexpected after signal SIGCONT on OS X
Diffstat (limited to 'sapi/phpdbg/phpdbg_io.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_io.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; } |