r15370: Fix more dependencies for shared libs
[samba.git] / source4 / lib / registry / tools / regpatch.c
index 713d4b32cc9df0ca83c27a743d152e958ec38391..6e584e90a816bde4ec45b42cc96a9b44e025b193 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "lib/events/events.h"
 #include "lib/registry/registry.h"
 #include "lib/cmdline/popt_common.h"
 #include "lib/registry/reg_backend_rpc.h"
@@ -41,17 +42,17 @@ int main(int argc, char **argv)
                POPT_TABLEEND
        };
 
-       registry_init();
-
        pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
 
        while((opt = poptGetNextOpt(pc)) != -1) {
        }
 
+       registry_init();
+
        if (remote) {
-               error = reg_open_remote (&h, cmdline_credentials, remote, NULL);
+               error = reg_open_remote (&h, NULL, cmdline_credentials, remote, NULL);
        } else {
-               error = reg_open_local (&h);
+               error = reg_open_local (&h, NULL, cmdline_credentials);
        }
 
        if (W_ERROR_IS_OK(error)) {