mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-03 02:13:35 +02:00
connection::thread_loop(): Break on zero reads
This commit is contained in:
parent
93882f79b9
commit
158ab85715
1 changed files with 2 additions and 0 deletions
|
@ -114,6 +114,8 @@ connection::thread_loop(void)
|
||||||
len = read(fd, cbuf, sizeof(cbuf));
|
len = read(fd, cbuf, sizeof(cbuf));
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
error = true;
|
error = true;
|
||||||
|
} else if (len == 0) {
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
bool want_moar = false;
|
bool want_moar = false;
|
||||||
pthread_mutex_lock(&buf_lock);
|
pthread_mutex_lock(&buf_lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue