summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-02-18 13:36:44 +0100
committerThomas Haller <thaller@redhat.com>2022-02-24 09:38:53 +0100
commited9e3bac0357e4666f218e50f79c3e1208dfb71b (patch)
tree217100c6cf6fb79706ede170791fb3d2c63d1a5e
parent8bb85aecdac3cdb4fa3f09c6e053d4b99c29e04a (diff)
core: use NM_SHUTDOWN_TIMEOUT_1500_MSEC
At some places we scheduled a timeout in NM_SHUTDOWN_TIMEOUT_MAX_MSEC. There, we want to make sure that we don't take longer than NM_SHUTDOWN_TIMEOUT_MAX_MSEC. But this leaves the actual wait time unspecified. Those callers don't want to wait an undefined time. They really should be clear about how long they wait. Hence, use NM_SHUTDOWN_TIMEOUT_1500_MSEC which makes it clear this is 1500 msec but also chosen to be not longer than NM_SHUTDOWN_TIMEOUT_MAX_MSEC.
-rw-r--r--src/core/nm-firewall-utils.c2
-rw-r--r--src/core/nm-pacrunner-manager.c4
-rw-r--r--src/core/settings/nm-secret-agent.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/core/nm-firewall-utils.c b/src/core/nm-firewall-utils.c
index 75618d137b..8fa8059e00 100644
--- a/src/core/nm-firewall-utils.c
+++ b/src/core/nm-firewall-utils.c
@@ -546,7 +546,7 @@ _fw_nft_call(GBytes *stdin_buf,
call_data);
call_data->timeout_source =
- nm_g_source_attach(nm_g_timeout_source_new((NM_SHUTDOWN_TIMEOUT_MAX_MSEC * 2) / 3,
+ nm_g_source_attach(nm_g_timeout_source_new((NM_SHUTDOWN_TIMEOUT_1500_MSEC * 2) / 3,
G_PRIORITY_DEFAULT,
_fw_nft_call_timeout_cb,
call_data,
diff --git a/src/core/nm-pacrunner-manager.c b/src/core/nm-pacrunner-manager.c
index 4d2fd0416a..86a406326e 100644
--- a/src/core/nm-pacrunner-manager.c
+++ b/src/core/nm-pacrunner-manager.c
@@ -291,7 +291,7 @@ _call_destroy_proxy_configuration(NMPacrunnerManager *self,
g_variant_new("(o)", path),
G_VARIANT_TYPE("()"),
G_DBUS_CALL_FLAGS_NO_AUTO_START,
- NM_SHUTDOWN_TIMEOUT_MAX_MSEC,
+ NM_SHUTDOWN_TIMEOUT_1500_MSEC,
priv->cancellable,
_call_destroy_proxy_configuration_cb,
conf_id_ref(conf_id));
@@ -315,7 +315,7 @@ _call_create_proxy_configuration(NMPacrunnerManager *self,
conf_id->parameters,
G_VARIANT_TYPE("(o)"),
G_DBUS_CALL_FLAGS_NO_AUTO_START,
- NM_SHUTDOWN_TIMEOUT_MAX_MSEC,
+ NM_SHUTDOWN_TIMEOUT_1500_MSEC,
priv->cancellable,
_call_create_proxy_configuration_cb,
conf_id_ref(conf_id));
diff --git a/src/core/settings/nm-secret-agent.c b/src/core/settings/nm-secret-agent.c
index 2bfbb658cd..a3df449739 100644
--- a/src/core/settings/nm-secret-agent.c
+++ b/src/core/settings/nm-secret-agent.c
@@ -511,7 +511,7 @@ nm_secret_agent_cancel_call(NMSecretAgent *self, NMSecretAgentCallId *call_id)
g_variant_new("(os)", call_id->path, call_id->setting_name),
G_VARIANT_TYPE("()"),
G_DBUS_CALL_FLAGS_NO_AUTO_START,
- NM_SHUTDOWN_TIMEOUT_MAX_MSEC,
+ NM_SHUTDOWN_TIMEOUT_1500_MSEC,
NULL, /* this operation is not cancellable. We rely on the timeout. */
_call_cancel_cb,
call_id);