summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/src
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@redhat.com>2019-01-24 18:31:10 +0100
committerXavi Hernandez <xhernandez@redhat.com>2019-02-01 10:37:20 +0100
commit4674678951a1315975d66016fb55c49100b7819f (patch)
tree6572b7186f06c6405badc67cd1f3dbf450c4df6d /xlators/features/changelog/lib/src
parent6b98735956c599ea621fa560b201fb7de6c36cac (diff)
core: make gf_thread_create() easier to use
This patch creates a specific function to set the thread name using a string format and a variable argument list, like printf(). This function is used to set the thread name from gf_thread_create(), which now accepts a variable argument list to create the full name. It's not necessary anymore to use a local array to build the name of the thread. This is done automatically. Change-Id: Idd8d01fd462c227359b96e98699f8c6d962dc17c Updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'xlators/features/changelog/lib/src')
-rw-r--r--xlators/features/changelog/lib/src/gf-history-changelog.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/xlators/features/changelog/lib/src/gf-history-changelog.c b/xlators/features/changelog/lib/src/gf-history-changelog.c
index 3e384ea0784..3d5fc8c8573 100644
--- a/xlators/features/changelog/lib/src/gf-history-changelog.c
+++ b/xlators/features/changelog/lib/src/gf-history-changelog.c
@@ -564,9 +564,6 @@ gf_history_consume(void *data)
{0},
};
gf_changelog_consume_data_t *curr = NULL;
- char thread_name[GF_THREAD_NAMEMAX] = {
- 0,
- };
hist_data = (gf_changelog_history_data_t *)data;
if (hist_data == NULL) {
@@ -612,12 +609,10 @@ gf_history_consume(void *data)
curr->retval = 0;
memset(curr->changelog, '\0', PATH_MAX);
- snprintf(thread_name, sizeof(thread_name), "clogc%03hx",
- ((iter + 1) & 0x3ff));
ret = gf_thread_create(&th_id[iter], NULL,
gf_changelog_consume_wrap, curr,
- thread_name);
+ "clogc%03hx", (iter + 1) & 0x3ff);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, ret,
CHANGELOG_LIB_MSG_THREAD_CREATION_FAILED,