journald: use rate-limited logging to log 'Failed to write entry' message

This commit is contained in:
Richard Phibel
2022-08-24 21:39:20 +01:00
committed by Luca Boccassi
parent 298b3de6d4
commit 34683dbdd0
5 changed files with 68 additions and 4 deletions
+7
View File
@@ -30,9 +30,16 @@ bool ratelimit_below(RateLimit *r) {
if (r->num < r->burst)
goto good;
r->num++;
return false;
good:
r->num++;
return true;
}
unsigned ratelimit_num_dropped(RateLimit *r) {
assert(r);
return r->num > r->burst ? r->num - r->burst : 0;
}