Fixed phpdbg exit unexpected after signal SIGCONT on OS X

This commit is contained in:
Reeze Xia 2015-05-26 22:04:50 +08:00
parent 4faf7476f9
commit ca31711625

View File

@ -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;
}