aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-05 17:44:44 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-05 17:44:44 +0000
commite0ba99b7f5b9f06dda7fe4baa8a7fb90e2ab40c8 (patch)
tree6334c0ffd529b865c510fbfb7a06b71e2c6d6ceb /app.c
parent54a140d030be645458cc82416501f0386e1d9e4b (diff)
Bug 6873 - Finish moving from the non-threadsafe (and poor randomness) rand() to threadsafe ast_random()
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17627 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rw-r--r--app.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/app.c b/app.c
index 0bd8612f9..e6c7f4625 100644
--- a/app.c
+++ b/app.c
@@ -1157,7 +1157,7 @@ enum AST_LOCK_RESULT ast_lock_path(const char *path)
return AST_LOCK_FAILURE;
}
- snprintf(fs, strlen(path) + 19, "%s/.lock-%08x", path, rand());
+ snprintf(fs, strlen(path) + 19, "%s/.lock-%08lx", path, ast_random());
fd = open(fs, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd < 0) {
fprintf(stderr, "Unable to create lock file '%s': %s\n", path, strerror(errno));