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

Aaron LI aly at crater.dragonflybsd.org
Sun Feb 21 00:20:04 PST 2021


commit 3e77f79f44e10f45b9577c79980287f57928d308
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/3e77f79f44e10f45b9577c79980287f57928d308


-- 
DragonFly BSD source repository


More information about the Commits mailing list