diff options
| author | Volker Lendecke <vl@samba.org> | 2014-06-02 22:29:44 +0200 |
|---|---|---|
| committer | Jeremy Allison <jra@samba.org> | 2014-06-18 18:51:13 +0200 |
| commit | 748ffccd5a1143048cbfe7b20fc6e850eb99cb2f (patch) | |
| tree | f58f2713e29ee270cca22aa1f4c5fbcc10dd5eb9 /source3/lib | |
| parent | 516e2f5e68aa10306a346865922b35e9a1e299c2 (diff) | |
| download | samba-748ffccd5a1143048cbfe7b20fc6e850eb99cb2f.tar.gz samba-748ffccd5a1143048cbfe7b20fc6e850eb99cb2f.tar.xz samba-748ffccd5a1143048cbfe7b20fc6e850eb99cb2f.zip | |
messaging3: Remove use of full_path_tos()
This is not performance critical, and this removes source3 specific
code
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.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index edef8892d3..8836bf8c81 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -57,9 +57,8 @@ static int messaging_dgm_context_destructor(struct messaging_dgm_context *c); static int messaging_dgm_lockfile_create(const char *cache_dir, pid_t pid, int *plockfile_fd, uint64_t unique) { - char buf[PATH_MAX]; - char *dir, *to_free; - ssize_t dirlen; + fstring buf; + char *dir; char *lockfile_name; int lockfile_fd; struct flock lck = {}; @@ -67,9 +66,8 @@ static int messaging_dgm_lockfile_create(const char *cache_dir, pid_t pid, ssize_t written; bool ok; - dirlen = full_path_tos(cache_dir, "lck", buf, sizeof(buf), - &dir, &to_free); - if (dirlen == -1) { + dir = talloc_asprintf(talloc_tos(), "%s/lck", cache_dir); + if (dir == NULL) { return ENOMEM; } @@ -78,13 +76,13 @@ static int messaging_dgm_lockfile_create(const char *cache_dir, pid_t pid, ret = errno; DEBUG(1, ("%s: Could not create lock directory: %s\n", __func__, strerror(ret))); - TALLOC_FREE(to_free); + TALLOC_FREE(dir); return ret; } lockfile_name = talloc_asprintf(talloc_tos(), "%s/%u", dir, (unsigned)pid); - TALLOC_FREE(to_free); + TALLOC_FREE(dir); if (lockfile_name == NULL) { DEBUG(1, ("%s: talloc_asprintf failed\n", __func__)); return ENOMEM; |
