git: grdc(6): Fix 100% CPU usage and make timeout work again

Aaron LI aly at crater.dragonflybsd.org
Sun Feb 21 00:18:30 PST 2021


commit cf2f35f41de10cbe6d13ea1ae381dba3a5b08a55
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Feb 21 12:02:19 2021 +0800

    grdc(6): Fix 100% CPU usage and make timeout work again
    
    grdc(6) was passing a timespec with tv_nsec = 1000000*1000, which is
    invalid.  So every nanosleep() call just returns with EINVAL error.
    This causes grdc(6) to loop hard and uses 100% CPU.  It also brreaks
    the optional timeout argument; grdc(6) just exits immediately.
    
    Fix the above issue by correctly setting the timespec argument.
    
    This fix also makes the optional timeout argument work again.

Summary of changes:
 games/grdc/grdc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cf2f35f41de10cbe6d13ea1ae381dba3a5b08a55


-- 
DragonFly BSD source repository



More information about the Commits mailing list