diff options
author | Gaurav <gaurav@gluster.com> | 2011-01-31 04:25:23 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-04 00:39:20 -0800 |
commit | f3648c88ebc6d58a10854d564d3fc2c82290ce13 (patch) | |
tree | bf7d14ba0ae498e96d39fdd35d0f47c75b860acc /libglusterfs/src/common-utils.c | |
parent | ba40a3ece0a0b5b381e7d05c74d09cdd1818b817 (diff) |
Logging : New uuid to string conversion functions.
Signed-off-by: Gaurav <gaurav@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2308 (Threadsafe uuid to string conversion function)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2308
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 727983d0682..38623dc79ac 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -46,11 +46,11 @@ #include "revision.h" #include "glusterfs.h" #include "stack.h" +#include "globals.h" typedef int32_t (*rw_op_t)(int32_t fd, char *buf, int32_t size); typedef int32_t (*rwv_op_t)(int32_t fd, const struct iovec *buf, int32_t size); - struct dnscache6 { struct addrinfo *first; struct addrinfo *next; @@ -1693,3 +1693,21 @@ out: return ret; } +/*Thread safe conversion function*/ +char * +uuid_utoa (uuid_t uuid) +{ + char *uuid_buffer = glusterfs_uuid_buf_get(); + uuid_unparse (uuid, uuid_buffer); + return uuid_buffer; +} + +/*Re-entrant conversion function*/ +char * +uuid_utoa_r (uuid_t uuid, char *dst) +{ + if(!dst) + return NULL; + uuid_unparse (uuid, dst); + return dst; +} |