Skip to content

Commit

Permalink
Fixed phpdbg exit unexpected after signal SIGCONT on OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
reeze committed May 26, 2015
1 parent 4faf747 commit ca31711
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sapi/phpdbg/phpdbg_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down

0 comments on commit ca31711

Please sign in to comment.