From 633f9c2d5e09a8c6a91607d6eed2fa6ef5508be9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 9 Sep 2022 15:27:26 +0200 Subject: [PATCH] module-rt: only call set_rlimit once We can call this once after we know that we can use RTKit to get the limits or not. --- src/modules/module-rt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/module-rt.c b/src/modules/module-rt.c index 2122a9b7a..5cfd766e4 100644 --- a/src/modules/module-rt.c +++ b/src/modules/module-rt.c @@ -976,7 +976,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) if (set_nice(impl, impl->nice_level, !can_use_rtkit) < 0) use_rtkit = can_use_rtkit; } - set_rlimit(impl); #ifdef HAVE_DBUS impl->use_rtkit = use_rtkit; @@ -1007,12 +1006,12 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) goto error; } } - /* Retry set_nice and set_rlimit with rtkit */ + /* Retry set_nice with rtkit */ if (IS_VALID_NICE_LEVEL(impl->nice_level)) set_nice(impl, impl->nice_level, true); - set_rlimit(impl); } #endif + set_rlimit(impl); impl->thread_utils.iface = SPA_INTERFACE_INIT( SPA_TYPE_INTERFACE_ThreadUtils,