Use a common define for the reload timeout

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-07-22 22:34:20 +02:00
parent 6ce4de290f
commit 5df2a4a6e0
4 changed files with 10 additions and 12 deletions
+2 -6
View File
@@ -37,12 +37,8 @@ int daemon_reload(enum action action, bool graceful) {
if (r < 0)
return bus_log_create_error(r);
/* Note we use an extra-long timeout here. This is because a reload or reexec means generators are
* rerun which are timed out after DEFAULT_TIMEOUT_USEC. Let's use twice that time here, so that the
* generators can have their timeout, and for everything else there's the same time budget in
* place. */
r = sd_bus_call(bus, m, DEFAULT_TIMEOUT_USEC * 2, &error, NULL);
/* Reloading the daemon may take long, hence set a longer timeout here */
r = sd_bus_call(bus, m, DAEMON_RELOAD_TIMEOUT_SEC, &error, NULL);
/* On reexecution, we expect a disconnect, not a reply */
if (IN_SET(r, -ETIMEDOUT, -ECONNRESET) && action == ACTION_REEXEC)