diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/service.c | 2 | ||||
-rw-r--r-- | src/shared/ratelimit.h | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c index d82803db2b..0c29d4aefa 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3655,6 +3655,8 @@ static void service_reset_failed(Unit *u) { s->result = SERVICE_SUCCESS; s->reload_result = SERVICE_SUCCESS; + + RATELIMIT_RESET(s->start_limit); } static int service_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *error) { diff --git a/src/shared/ratelimit.h b/src/shared/ratelimit.h index 07e8205c81..ad00267a6e 100644 --- a/src/shared/ratelimit.h +++ b/src/shared/ratelimit.h @@ -48,6 +48,13 @@ typedef struct RateLimit { _r->begin = 0; \ } while (false) +#define RATELIMIT_RESET(v) \ + do { \ + RateLimit *_r = &(v); \ + _r->num = 0; \ + _r->begin = 0; \ + } while (false) + bool ratelimit_test(RateLimit *r); #endif |