summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/tier.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-10-01 16:31:19 -0400
committerJeff Darcy <jdarcy@redhat.com>2015-10-28 13:38:42 -0700
commit3066a21caafab6305527991de11c8eb43ec0044c (patch)
tree5efc91272ac76ff1613cee1e8a41aeb32aa92d73 /xlators/cluster/dht/src/tier.c
parent063d4ead61ee47433793de81a1c77e0ba69e6e07 (diff)
core: use syscall wrappers instead of direct syscalls - miscellaneous
various xlators and other components are invoking system calls directly instead of using the libglusterfs/syscall.[ch] wrappers. If not using the system call wrappers there should be a comment in the source explaining why the wrapper isn't used. Change-Id: I1f47820534c890a00b452fa61f7438eb2b3f667c BUG: 1267967 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/12276 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/tier.c')
-rw-r--r--xlators/cluster/dht/src/tier.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index bd78e7849d0..9930fe063e1 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -12,6 +12,7 @@
#include "dht-common.h"
#include "tier.h"
+#include "syscall.h"
/*Hard coded DB info*/
static gfdb_db_type_t dht_tier_db_type = GFDB_SQLITE3;
@@ -1088,8 +1089,8 @@ tier_migrate_files_using_qfile (demotion_args_t *comp,
fclose (query_cbk_args->queryFILE);
query_cbk_args->queryFILE = NULL;
if (ret) {
- sprintf (renamed_file, "%s.err", qfile);
- rename (qfile, renamed_file);
+ snprintf (renamed_file, sizeof renamed_file, "%s.err", qfile);
+ sys_rename (qfile, renamed_file);
}
out:
return ret;
@@ -1224,7 +1225,7 @@ tier_get_bricklist (xlator_t *xl, struct list_head *local_bricklist_head)
goto out;
}
- sprintf(local_brick->brick_db_path, "%s/%s/%s", rv,
+ snprintf(local_brick->brick_db_path, PATH_MAX, "%s/%s/%s", rv,
GF_HIDDEN_PATH,
db_name);
@@ -1855,8 +1856,8 @@ tier_init (xlator_t *this)
goto out;
}
- unlink (promotion_qfile);
- unlink (demotion_qfile);
+ sys_unlink(promotion_qfile);
+ sys_unlink(demotion_qfile);
gf_msg (this->name, GF_LOG_INFO, 0,
DHT_MSG_LOG_TIER_STATUS,