s3:net ads join: reduce indentation in _net_ads_join_dns_updates()
[ira/wip.git] / source3 / utils / net_g_lock.c
index bfb9a225abd4889eb1c43c5a9b7964f91c98e96b..b9d99160bc5fdceaa4fd808f4b53ca36cee066fd 100644 (file)
@@ -36,7 +36,7 @@ static bool net_g_lock_init(TALLOC_CTX *mem_ctx,
                d_fprintf(stderr, "ERROR: could not init event context\n");
                goto fail;
        }
-       msg = messaging_init(mem_ctx, procid_self(), ev);
+       msg = messaging_init(mem_ctx, ev);
        if (msg == NULL) {
                d_fprintf(stderr, "ERROR: could not init messaging context\n");
                goto fail;
@@ -91,7 +91,7 @@ static int net_g_lock_do(struct net_context *c, int argc, const char **argv)
 
        status = g_lock_do(name, G_LOCK_WRITE,
                           timeval_set(timeout / 1000, timeout % 1000),
-                          procid_self(), net_g_lock_do_fn, &state);
+                          net_g_lock_do_fn, &state);
        if (!NT_STATUS_IS_OK(status)) {
                d_fprintf(stderr, "ERROR: g_lock_do failed: %s\n",
                          nt_errstr(status));
@@ -175,7 +175,7 @@ done:
        TALLOC_FREE(g_ctx);
        TALLOC_FREE(msg);
        TALLOC_FREE(ev);
-       return ret;
+       return ret < 0 ? -1 : ret;
 }
 
 int net_g_lock(struct net_context *c, int argc, const char **argv)