]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:notifyd: Use lpcfg_set_cmdline()
authorPavel Kalugin <pkalugin@inno.tech>
Mon, 14 Aug 2023 01:37:16 +0000 (04:37 +0300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Sep 2023 21:35:29 +0000 (21:35 +0000)
Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/notifyd/notifydd.c

index 26bfcd8e410f9761a1846ea1085de87dfaefe7a7..b27a4ab5de593370c896f4fdadaeb8a293257b23 100644 (file)
 #include "lib/messages_ctdb.h"
 #include <tevent.h>
 #include "lib/util/tevent_unix.h"
+#include "lib/param/param.h"
 
 int main(int argc, const char *argv[])
 {
        TALLOC_CTX *frame;
+       struct loadparm_context *lp_ctx = NULL;
        struct tevent_context *ev;
        struct messaging_context *msg;
        struct tevent_req *req;
@@ -36,8 +38,15 @@ int main(int argc, const char *argv[])
 
        frame = talloc_stackframe();
 
+       lp_ctx = loadparm_init_s3(frame, loadparm_s3_helpers());
+       if (lp_ctx == NULL) {
+               fprintf(stderr,
+                       "Failed to initialise the global parameter structure.\n");
+               return 1;
+       }
+
        setup_logging("notifyd", DEBUG_DEFAULT_STDOUT);
-       lp_set_cmdline("log level", "10");
+       lpcfg_set_cmdline(lp_ctx, "log level", "10");
 
        ok = lp_load_initial_only(get_dyn_CONFIGFILE());
        if (!ok) {