Commit 5cb13f3c authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Fix 100% cpu bug when controller connection is lost.

parent bf05625e
......@@ -222,11 +222,14 @@ int main (int argc, char **argv)
}
}
if (ret < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
if (ret == 0 ||
(ret < 0 && errno != EAGAIN && errno != EWOULDBLOCK)) {
printf("Close connection to server\n");
close(fd_log);
fd_log = -1;
entry = log_entry_alloc();
log_string(entry->buffer, LOG_ENTRY_LEN, LOG_T_ERROR,
"Lost connection to controller");
entry->buffer[strlen(entry->buffer)+1] = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment