]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: fix the return type for xxx_running_timeout() functions
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 28 Sep 2021 21:08:32 +0000 (23:08 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 29 Sep 2021 03:28:21 +0000 (12:28 +0900)
otherwise we might return an invalid value, since `usec_t` is 64-bit,
whereas `int` might not be.

Follow-up to: 5918a93
Fixes: #20872
src/core/scope.c
src/core/service.c

index 8fdba646aa4bc8ccf035122c462e17c27ee50b9e..74f16233c5894a3b7c2f3ed7a50e40ee01eba6f7 100644 (file)
@@ -52,7 +52,7 @@ static void scope_done(Unit *u) {
         s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
 }
 
-static int scope_running_timeout(Scope *s) {
+static usec_t scope_running_timeout(Scope *s) {
         usec_t delta = 0;
 
         assert(s);
index 68485a241f4b8ee1624cd75b5d62e2b4cbaf4465..9299813d45eca120ff0bc056d13d8828c982ae85 100644 (file)
@@ -515,7 +515,7 @@ static void service_remove_fd_store(Service *s, const char *name) {
         }
 }
 
-static int service_running_timeout(Service *s) {
+static usec_t service_running_timeout(Service *s) {
         usec_t delta = 0;
 
         assert(s);