mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-20 16:35:38 +08:00
exit a loop if read() returns 0 because socket might be closed
related to http://hipbyte.myjetbrains.com/youtrack/issue/RM-309 This will fix a freeze when terminate lldb with "quit" command
This commit is contained in:
@@ -898,12 +898,18 @@ start_debug_server(am_device_t dev)
|
||||
if (len > 0) {
|
||||
write(gdb_fd, buf, len);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (FD_ISSET(gdb_fd, &read_fds)) {
|
||||
len = read(gdb_fd, buf, sizeof buf);
|
||||
if (len > 0) {
|
||||
write(lldb_socket, buf, len);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user