summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-06-02 23:01:46 +0200
committerJeremy Allison <jra@samba.org>2014-06-18 18:51:13 +0200
commit94db1b21d062099e1a0e2f290fc12e458c6c6f76 (patch)
tree3a0f9a7e8e98ab63e19561bc292c7d653223e1e0 /source3/lib
parent748ffccd5a1143048cbfe7b20fc6e850eb99cb2f (diff)
downloadsamba-94db1b21d062099e1a0e2f290fc12e458c6c6f76.tar.gz
samba-94db1b21d062099e1a0e2f290fc12e458c6c6f76.tar.xz
samba-94db1b21d062099e1a0e2f290fc12e458c6c6f76.zip
messaging3: Remove two uses of talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages_dgm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 8836bf8c81..09b635db56 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -54,7 +54,8 @@ static void messaging_dgm_recv(struct unix_msg_ctx *ctx,
static int messaging_dgm_context_destructor(struct messaging_dgm_context *c);
-static int messaging_dgm_lockfile_create(const char *cache_dir, pid_t pid,
+static int messaging_dgm_lockfile_create(TALLOC_CTX *tmp_ctx,
+ const char *cache_dir, pid_t pid,
int *plockfile_fd, uint64_t unique)
{
fstring buf;
@@ -66,7 +67,7 @@ static int messaging_dgm_lockfile_create(const char *cache_dir, pid_t pid,
ssize_t written;
bool ok;
- dir = talloc_asprintf(talloc_tos(), "%s/lck", cache_dir);
+ dir = talloc_asprintf(tmp_ctx, "%s/lck", cache_dir);
if (dir == NULL) {
return ENOMEM;
}
@@ -80,7 +81,7 @@ static int messaging_dgm_lockfile_create(const char *cache_dir, pid_t pid,
return ret;
}
- lockfile_name = talloc_asprintf(talloc_tos(), "%s/%u", dir,
+ lockfile_name = talloc_asprintf(tmp_ctx, "%s/%u", dir,
(unsigned)pid);
TALLOC_FREE(dir);
if (lockfile_name == NULL) {
@@ -221,7 +222,7 @@ NTSTATUS messaging_dgm_init(struct messaging_context *msg_ctx,
sec_init();
- ret = messaging_dgm_lockfile_create(cache_dir, pid.pid,
+ ret = messaging_dgm_lockfile_create(ctx, cache_dir, pid.pid,
&ctx->lockfile_fd, pid.unique_id);
if (ret != 0) {
DEBUG(1, ("%s: messaging_dgm_create_lockfile failed: %s\n",