]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
debug: Only initialize gpfs wrapper when gpfs logging is enabled
authorChristof Schmitt <cs@samba.org>
Thu, 13 Apr 2023 18:13:00 +0000 (11:13 -0700)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Apr 2023 12:28:23 +0000 (12:28 +0000)
This avoids unnecessary attempts to load libgpfs.so when it is not
needed.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Apr 14 12:28:23 UTC 2023 on atb-devel-224

lib/util/debug.c

index 95de5ce3595612de8275973f900aa0f7544d2a1b..b83075cb2392dfad6138403b24023e06f761f9ec 100644 (file)
@@ -406,7 +406,9 @@ static void debug_lttng_log(int msg_level, const char *msg, size_t msg_len)
 static void debug_gpfs_reload(bool enabled, bool previously_enabled,
                              const char *prog_name, char *option)
 {
-       gpfswrap_init();
+       if (enabled) {
+               gpfswrap_init();
+       }
 
        if (enabled && !previously_enabled) {
                gpfswrap_init_trace();