1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

core: serialize and deserialize trigger ratelimits for socket and path

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-11-17 18:10:50 +01:00 committed by Luca Boccassi
parent fed25720ef
commit 51ad723d20
2 changed files with 12 additions and 2 deletions

View File

@ -682,6 +682,8 @@ static int path_serialize(Unit *u, FILE *f, FDSet *fds) {
escaped);
}
(void) serialize_ratelimit(f, "trigger-ratelimit", &p->trigger_limit);
return 0;
}
@ -743,7 +745,10 @@ static int path_deserialize_item(Unit *u, const char *key, const char *value, FD
}
}
} else
} else if (streq(key, "trigger-ratelimit"))
deserialize_ratelimit(&p->trigger_limit, key, value);
else
log_unit_debug(u, "Unknown serialization key: %s", key);
return 0;

View File

@ -2589,6 +2589,8 @@ static int socket_serialize(Unit *u, FILE *f, FDSet *fds) {
}
}
(void) serialize_ratelimit(f, "trigger-ratelimit", &s->trigger_limit);
return 0;
}
@ -2823,7 +2825,10 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
if (!found)
log_unit_debug(u, "No matching ffs socket found: %s", value);
} else
} else if (streq(key, "trigger-ratelimit"))
deserialize_ratelimit(&s->trigger_limit, key, value);
else
log_unit_debug(UNIT(s), "Unknown serialization key: %s", key);
return 0;