]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: const and pure'ify service_restart_usec_next()
authorMike Yuan <me@yhndnzj.com>
Mon, 15 Dec 2025 21:03:53 +0000 (22:03 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 17 Dec 2025 23:39:59 +0000 (00:39 +0100)
src/core/service.c
src/core/service.h

index 9f7ccaaa4126491cf9b50838b1a056e6831e70c3..46caa1d3e372584e58bbae6b5d945dc491011f80 100644 (file)
@@ -348,7 +348,7 @@ static void service_start_watchdog(Service *s) {
                 log_unit_warning_errno(UNIT(s), r, "Failed to install watchdog timer: %m");
 }
 
-usec_t service_restart_usec_next(Service *s) {
+usec_t service_restart_usec_next(const Service *s) {
         unsigned n_restarts_next;
 
         assert(s);
index 06fafb54822cb21d0bc828636cb2e54d1cb8b847..7d51c57f6cc5524a84353b77921f9f2ecdf44509 100644 (file)
@@ -266,7 +266,7 @@ extern const UnitVTable service_vtable;
 int service_set_socket_fd(Service *s, int fd, struct Socket *socket, struct SocketPeer *peer, bool selinux_context_net);
 void service_release_socket_fd(Service *s);
 
-usec_t service_restart_usec_next(Service *s);
+usec_t service_restart_usec_next(const Service *s) _pure_;
 
 int service_determine_exec_selinux_label(Service *s, char **ret);