mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
core: serialize and deserialize auto start/stop ratelimit
The limit is not configurable, so the logic in the helper will always update the counters. The helper is a bit overkill, but it doesn't really matter.
This commit is contained in:
committed by
Luca Boccassi
parent
6ef512c0bb
commit
b2bd488e76
@@ -141,6 +141,7 @@ int unit_serialize_state(Unit *u, FILE *f, FDSet *fds, bool switching_root) {
|
||||
(void) serialize_dual_timestamp(f, "assert-timestamp", &u->assert_timestamp);
|
||||
|
||||
(void) serialize_ratelimit(f, "start-ratelimit", &u->start_ratelimit);
|
||||
(void) serialize_ratelimit(f, "auto-start-stop-ratelimit", &u->auto_start_stop_ratelimit);
|
||||
|
||||
if (dual_timestamp_is_set(&u->condition_timestamp))
|
||||
(void) serialize_bool(f, "condition-result", u->condition_result);
|
||||
@@ -348,6 +349,9 @@ int unit_deserialize_state(Unit *u, FILE *f, FDSet *fds) {
|
||||
} else if (streq(l, "start-ratelimit")) {
|
||||
deserialize_ratelimit(&u->start_ratelimit, l, v);
|
||||
continue;
|
||||
} else if (streq(l, "auto-start-stop-ratelimit")) {
|
||||
deserialize_ratelimit(&u->auto_start_stop_ratelimit, l, v);
|
||||
continue;
|
||||
|
||||
} else if (MATCH_DESERIALIZE("condition-result", l, v, parse_boolean, u->condition_result))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user