Skip to content

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
Fixed bug where the daemon takes 100% CPU when the device is disconected.
  • Loading branch information
apocatarsis committed Aug 21, 2015
1 parent fc2f8c3 commit 4f68412
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/naga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class NagaDaemon{
int pid;
while (1){
rd = read (fd, ev, size * 64);
if (rd == -1) exit(1); //Thanks Destroyer!
value = ev[0].value;
if (value != ' ' && ev[1].value == 1 && ev[1].type == 1){ // Only read the key press event
for(int i=0;i<DEV_NUM_KEYS;i++){//For all keys
Expand Down

0 comments on commit 4f68412

Please sign in to comment.