com php-src: Fixed phpdbg exit unexpected after signal SIGCONT on OS X: sapi/phpdbg/phpdbg_io.c
| From: | Reeze Xia | Date: | Tue, 26 May 2015 14:04:50 +0000 |
| Subject: | com php-src: Fixed phpdbg exit unexpected after signal SIGCONT on OS X: sapi/phpdbg/phpdbg_io.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86937@lists.php.net to get a copy of this message | ||
Commit: ca31711625095c2d6e308d7f0fc9d371ad0934d4
Author: Reeze Xia <reeze@php.net> Tue, 26 May 2015 22:04:50 +0800
Parents: 4faf7476f9e6a6c57a3bf6bccf0752b33b7cf4b1
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ca31711625095c2d6e308d7f0fc9d371ad0934d4
Log:
Fixed phpdbg exit unexpected after signal SIGCONT on OS X
Changed paths:
M sapi/phpdbg/phpdbg_io.c
Diff:
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index 1f004fb..58ea06e 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;
}