Changeset 5d557e747257b9a91c7870bfda3448f767b74f14
- Timestamp:
- 01/30/09 04:59:59
(4 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1233291599 +0000
- git-parent:
[8ea07be0a527c4fb8256ad375157caee1f2d1bdc]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1233291599 +0000
- Message:
set offset to zero if the check is NP_TRANSIENT, closes #75
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5247186 |
r5d557e7 |
|
| 85 | 85 | struct timeval now, period; |
|---|
| 86 | 86 | double r; |
|---|
| 87 | | int offset, max; |
|---|
| 88 | | |
|---|
| 89 | | r = drand48(); |
|---|
| 90 | | max = noit_check_max_initial_stutter(); |
|---|
| 91 | | offset = r * (MIN(max, check->period)); |
|---|
| | 87 | int offset = 0, max; |
|---|
| | 88 | |
|---|
| | 89 | if(!(check->flags & NP_TRANSIENT)) { |
|---|
| | 90 | r = drand48(); |
|---|
| | 91 | max = noit_check_max_initial_stutter(); |
|---|
| | 92 | offset = r * (MIN(max, check->period)); |
|---|
| | 93 | } |
|---|
| 92 | 94 | period.tv_sec = (check->period - offset) / 1000; |
|---|
| 93 | 95 | period.tv_usec = ((check->period - offset) % 1000) * 1000; |
|---|