-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maxage calculation is changed #514
Comments
The use of difftime has caused this difference. |
I do not understand what exactly is wrong and what should be changed. |
Before 4eb3add, when maxage was set to 1, files from 48 hours ago were not deleted and only deleted after 48 hours or more. Now, they will be deleted after 24 hours or more |
kdudka
added a commit
to kdudka/logrotate
that referenced
this issue
May 5, 2023
... to restore the original behavior of `logrotate-3.19.0`, before we started to use difftime(), which returns a floating point number. Fixes: logrotate#514 Closes: https://github.com/logrotate/logrotate/pulls/515
Got it, thanks! I have proposed pull request #515 to fix this. |
kdudka
added a commit
to kdudka/logrotate
that referenced
this issue
May 5, 2023
... to restore the original behavior of `logrotate-3.19.0`, before we started to use `difftime()`, which returns a floating point number. Fixes: logrotate#514 Closes: logrotate#515
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
May 5, 2023
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
May 5, 2023
With the introduction of difftime(3) in commit 4eb3add ("Use difftime to compare time_t") to support platform with an unsigned time_t several arithmetic operations and comparisons turned from integer to floating point ones. This can lead to different results since integer divisions round down to the next integer while floating point divisions do not. Cast the result of difftime(3) to intmax_t to revert back to integer operations. Fixes: 4eb3add ("Use difftime to compare time_t") Fixes: logrotate#514
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
May 5, 2023
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
May 5, 2023
With the introduction of difftime(3) in commit 4eb3add ("Use difftime to compare time_t") to support platform with an unsigned time_t several arithmetic operations and comparisons turned from integer to floating point ones. This can lead to different results since integer divisions round down to the next integer while floating point divisions do not. Cast the result of difftime(3) to intmax_t to revert back to integer operations. Fixes: 4eb3add ("Use difftime to compare time_t") Fixes: logrotate#514
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
May 9, 2023
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
May 9, 2023
With the introduction of difftime(3) in commit 4eb3add ("Use difftime to compare time_t") to support platform with an unsigned time_t several arithmetic operations and comparisons turned from integer to floating point ones. This can lead to different results since integer divisions round down to the next integer while floating point divisions do not. Cast the result of difftime(3) to intmax_t to revert back to integer operations. Fixes: 4eb3add ("Use difftime to compare time_t") Fixes: logrotate#514
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
Jun 7, 2023
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
Jun 7, 2023
With the introduction of difftime(3) in commit 4eb3add ("Use difftime to compare time_t") to support platform with an unsigned time_t several arithmetic operations and comparisons turned from integer to floating point ones. This can lead to different results since integer divisions round down to the next integer while floating point divisions do not. Cast the result of difftime(3) to intmax_t to revert back to integer operations. Fixes: 4eb3add ("Use difftime to compare time_t") Fixes: logrotate#514
cgzones
added a commit
that referenced
this issue
Jun 30, 2023
cgzones
added a commit
that referenced
this issue
Jun 30, 2023
With the introduction of difftime(3) in commit 4eb3add ("Use difftime to compare time_t") to support platform with an unsigned time_t several arithmetic operations and comparisons turned from integer to floating point ones. This can lead to different results since integer divisions round down to the next integer while floating point divisions do not. Cast the result of difftime(3) to intmax_t to revert back to integer operations. Fixes: 4eb3add ("Use difftime to compare time_t") Fixes: #514
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With maxage set, any log file older than N days will to be purged.The relevant discussion can be seen in #39.
The text was updated successfully, but these errors were encountered: