search for: check_parent

Displaying 2 results from an estimated 2 matches for "check_parent".

2019 Mar 26
0
Bug: upssched and 3+ UPSes
...'ve stumbled over a race condition in upssched when using 3 or more UPSes in combination with START-TIMER/CANCEL-TIMER. I have a solution that works but is ugly, so I'm going to describe the bug here in the hope somebody can come up with a better solution. The problem is in upssched.c:629 check_parent() (see https://github.com/networkupstools/nut/blob/master/clients/upssched.c ). When all three UPSes goes on battery at the same time (think major power outage) upssched is started three times. This first upssched to get the lockfn file should start the timer-daemon while the other two upssched in...
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...791. Last-Update: Sat, 13 Aug 2011 14:04:48 +0300 Index: b/clients/upssched.c =================================================================== --- a/clients/upssched.c 2011-05-31 13:36:47.000000000 +0300 +++ b/clients/upssched.c 2011-08-17 00:40:17.000000000 +0300 @@ -652,7 +652,7 @@ static int check_parent(const char *cmd, unlink(lockfn); /* give the other one a chance to start it, then try again */ - usleep(250000); + struct timespec delay = {0, 250e6}; nanosleep(&delay, NULL); } upslog_with_errno(LOG_ERR, "Failed to connect to parent and failed to create parent"); @@ -...