summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2018-08-15 19:34:31 +0530
committerAmar Tumballi <amarts@redhat.com>2018-08-21 10:50:21 +0000
commitcb210f83455e2f659e734dfa09ff7602b5b75201 (patch)
treee355b6545f3d029d7fbd9cc3910bd347a89e567c /xlators
parent6fa531c57c633827283fba6a3cdaa1c68976ccb7 (diff)
glusterd: fix gcc warnings
...and also changed char array initialization to from {0,} to "". gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) on Fedora 28. Sample warnings: glusterd-utils.c:7234:41: warning: ‘.hostname’ directive output may be truncated writing 9 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf (key, sizeof (key), "%s.hostname", base_key); ^~~~~~~~~ glusterd-utils.c:7234:9: note: ‘snprintf’ output between 10 and 1033 bytes into a destination of size 1024 snprintf (key, sizeof (key), "%s.hostname", base_key); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glusterd-snapshot.c:3090:65: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4095 [-Wformat-truncation=] snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s", ^ glusterd-snapshot.c:3090:17: note: ‘snprintf’ output between 2 and 4351 bytes into a destination of size 4095 snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ snap_mount_dir, snap_vol->snapshot->snapname); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glusterd-statedump.c:28:45: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 144 [-Wformat-truncation=] snprintf (subkey, sizeof (subkey), "%s%d", key, index); ^~ ~~~ glusterd-statedump.c:28:9: note: ‘snprintf’ output between 2 and 4107 bytes into a destination of size 144 snprintf (subkey, sizeof (subkey), "%s%d", key, index); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ updates: bz#1193929 Change-Id: Ic721f27b28d1221c124b570e81c55528f5b7f3cd Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c62
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-statedump.c20
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c292
3 files changed, 187 insertions, 187 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 55fd0336f2b..9e9a3d26ad7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -62,7 +62,7 @@
#include "lvm-defaults.h"
#include "events.h"
-char snap_mount_dir[PATH_MAX];
+char snap_mount_dir[VALID_GLUSTERD_PATHMAX];
struct snap_create_args_ {
xlator_t *this;
dict_t *dict;
@@ -622,11 +622,11 @@ out:
int
glusterd_snapshot_backup_vol (glusterd_volinfo_t *volinfo)
{
- char pathname[PATH_MAX] = {0,};
+ char pathname[PATH_MAX] = "";
int ret = -1;
int op_ret = 0;
- char delete_path[PATH_MAX] = {0,};
- char trashdir[PATH_MAX] = {0,};
+ char delete_path[PATH_MAX] = "";
+ char trashdir[PATH_MAX] = "";
glusterd_conf_t *priv = NULL;
xlator_t *this = NULL;
int32_t len = 0;
@@ -963,7 +963,7 @@ glusterd_snapshot_restore_prevalidate (dict_t *dict, char **op_errstr,
int32_t volcount = 0;
int32_t brick_count = 0;
gf_boolean_t snap_restored = _gf_false;
- char key[PATH_MAX] = {0, };
+ char key[PATH_MAX] = "";
char *volname = NULL;
char *snapname = NULL;
glusterd_volinfo_t *volinfo = NULL;
@@ -1262,7 +1262,7 @@ glusterd_snapshot_config_prevalidate (dict_t *dict, char **op_errstr,
xlator_t *this = NULL;
int ret = -1;
int config_command = 0;
- char err_str[PATH_MAX] = {0,};
+ char err_str[PATH_MAX] = "";
glusterd_conf_t *conf = NULL;
uint64_t hard_limit = 0;
uint64_t soft_limit = 0;
@@ -1871,7 +1871,7 @@ glusterd_add_brick_status_to_dict (dict_t *dict, glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo,
char *key_prefix)
{
- char pidfile[PATH_MAX] = {0, };
+ char pidfile[PATH_MAX] = "";
int32_t brick_online = 0;
pid_t pid = 0;
xlator_t *this = NULL;
@@ -2784,8 +2784,8 @@ glusterd_do_lvm_snapshot_remove (glusterd_volinfo_t *snap_vol,
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
runner_t runner = {0,};
- char msg[1024] = {0, };
- char pidfile[PATH_MAX] = {0, };
+ char msg[1024] = "";
+ char pidfile[PATH_MAX] = "";
pid_t pid = -1;
int retry_count = 0;
char *mnt_pt = NULL;
@@ -2913,7 +2913,7 @@ glusterd_lvm_snapshot_remove (dict_t *rsp_dict, glusterd_volinfo_t *snap_vol)
glusterd_brickinfo_t *brickinfo = NULL;
xlator_t *this = NULL;
char brick_dir[PATH_MAX] = "";
- char snap_path[PATH_MAX] = "";
+ char snap_path[PATH_MAX] = "";
char *tmp = NULL;
char *brick_mount_path = NULL;
gf_boolean_t is_brick_dir_present = _gf_false;
@@ -3097,7 +3097,7 @@ remove_brick_path:
goto out;
}
- snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
+ snprintf (snap_path, sizeof (snap_path), "%s/%s",
snap_mount_dir, snap_vol->snapshot->snapname);
ret = recursive_rmdir (snap_path);
if (ret) {
@@ -3285,7 +3285,7 @@ glusterd_snapshot_get_snapvol_detail (dict_t *dict,
{
int ret = -1;
int snap_limit = 0;
- char key[PATH_MAX] = {0,};
+ char key[PATH_MAX] = "";
char *value = NULL;
glusterd_volinfo_t *origin_vol = NULL;
glusterd_conf_t *conf = NULL;
@@ -3444,8 +3444,8 @@ glusterd_snapshot_get_snap_detail (dict_t *dict, glusterd_snap_t *snap,
{
int ret = -1;
int volcount = 0;
- char key[PATH_MAX] = {0,};
- char timestr[64] = {0,};
+ char key[PATH_MAX] = "";
+ char timestr[64] = "";
char *value = NULL;
glusterd_volinfo_t *snap_vol = NULL;
glusterd_volinfo_t *tmp_vol = NULL;
@@ -3609,7 +3609,7 @@ glusterd_snapshot_get_all_snap_info (dict_t *dict)
{
int ret = -1;
int snapcount = 0;
- char key[PATH_MAX] = {0,};
+ char key[PATH_MAX] = "";
glusterd_snap_t *snap = NULL;
glusterd_snap_t *tmp_snap = NULL;
glusterd_conf_t *priv = NULL;
@@ -3905,7 +3905,7 @@ glusterd_snapshot_get_all_snapnames (dict_t *dict)
int ret = -1;
int snapcount = 0;
char *snapname = NULL;
- char key[PATH_MAX] = {0,};
+ char key[PATH_MAX] = "";
glusterd_snap_t *snap = NULL;
glusterd_snap_t *tmp_snap = NULL;
glusterd_conf_t *priv = NULL;
@@ -3958,7 +3958,7 @@ glusterd_snapshot_get_vol_snapnames (dict_t *dict, glusterd_volinfo_t *volinfo)
int ret = -1;
int snapcount = 0;
char *snapname = NULL;
- char key[PATH_MAX] = {0,};
+ char key[PATH_MAX] = "";
glusterd_volinfo_t *snap_vol = NULL;
glusterd_volinfo_t *tmp_vol = NULL;
xlator_t *this = NULL;
@@ -4089,9 +4089,9 @@ glusterd_handle_snapshot_create (rpcsvc_request_t *req, glusterd_op_t op,
uuid_t tmp_uuid = {0};
int i = 0;
int timestamp = 0;
- char snap_volname[GD_VOLUME_NAME_MAX] = {0, };
- char new_snapname[GLUSTERD_MAX_SNAP_NAME] = {0, };
- char gmt_snaptime[GLUSTERD_MAX_SNAP_NAME] = {0, };
+ char snap_volname[GD_VOLUME_NAME_MAX] = "";
+ char new_snapname[GLUSTERD_MAX_SNAP_NAME] = "";
+ char gmt_snaptime[GLUSTERD_MAX_SNAP_NAME] = "";
time_t snap_time;
this = THIS;
GF_ASSERT (this);
@@ -4325,7 +4325,7 @@ glusterd_handle_snapshot_clone (rpcsvc_request_t *req, glusterd_op_t op,
uuid_t *uuid_ptr = NULL;
uuid_t tmp_uuid = {0};
int i = 0;
- char snap_volname[GD_VOLUME_NAME_MAX] = {0, };
+ char snap_volname[GD_VOLUME_NAME_MAX] = "";
this = THIS;
GF_ASSERT (this);
@@ -4944,7 +4944,7 @@ glusterd_add_brick_to_snap_volume (dict_t *dict, dict_t *rsp_dict,
gf_boolean_t add_missed_snap = _gf_false;
int32_t ret = -1;
xlator_t *this = NULL;
- char abspath[PATH_MAX] = {0};
+ char abspath[PATH_MAX] = "";
int32_t len = 0;
this = THIS;
@@ -6340,7 +6340,7 @@ glusterd_snapshot_deactivate_commit (dict_t *dict, char **op_errstr,
/*Remove /var/run/gluster/snaps/<snap-name> entry for deactivated snaps.
* This entry will be created again during snap activate.
*/
- snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
+ snprintf (snap_path, sizeof (snap_path), "%s/%s",
snap_mount_dir, snapname);
ret = recursive_rmdir (snap_path);
if (ret) {
@@ -8146,8 +8146,8 @@ glusterd_handle_snap_limit (dict_t *dict, dict_t *rsp_dict)
int64_t volcount = 0;
int i = 0;
char *volname = NULL;
- char key[PATH_MAX] = {0, };
- char msg[PATH_MAX] = {0, };
+ char key[PATH_MAX] = "";
+ char msg[PATH_MAX] = "";
glusterd_volinfo_t *volinfo = NULL;
uint64_t limit = 0;
int64_t count = 0;
@@ -8678,7 +8678,7 @@ glusterd_snapshot_brickop (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
int ret = -1;
int64_t vol_count = 0;
int64_t count = 1;
- char key[1024] = {0,};
+ char key[1024] = "";
char *volname = NULL;
int32_t snap_command = 0;
xlator_t *this = NULL;
@@ -9032,8 +9032,8 @@ int
glusterd_snapshot_revert_partial_restored_vol (glusterd_volinfo_t *volinfo)
{
int ret = 0;
- char pathname [PATH_MAX] = {0,};
- char trash_path[PATH_MAX] = {0,};
+ char pathname[PATH_MAX] = "";
+ char trash_path[PATH_MAX] = "";
glusterd_brickinfo_t *brickinfo = NULL;
glusterd_volinfo_t *reverted_vol = NULL;
glusterd_volinfo_t *snap_vol = NULL;
@@ -9147,7 +9147,7 @@ int
glusterd_snapshot_revert_restore_from_snap (glusterd_snap_t *snap)
{
int ret = -1;
- char volname [PATH_MAX] = {0,};
+ char volname[PATH_MAX] = "";
glusterd_volinfo_t *snap_volinfo = NULL;
glusterd_volinfo_t *volinfo = NULL;
xlator_t *this = NULL;
@@ -9493,7 +9493,7 @@ glusterd_handle_snapshot_fn (rpcsvc_request_t *req)
int type = 0;
glusterd_conf_t *conf = NULL;
char *host_uuid = NULL;
- char err_str[2048] = {0,};
+ char err_str[2048] = "";
xlator_t *this = NULL;
uint32_t op_errno = 0;
@@ -10235,7 +10235,7 @@ glusterd_snapshot_get_volnames_uuids (dict_t *dict,
{
int ret = -1;
int snapcount = 0;
- char key[PATH_MAX] = {0,};
+ char key[PATH_MAX] = "";
glusterd_volinfo_t *snap_vol = NULL;
glusterd_volinfo_t *volinfo = NULL;
glusterd_volinfo_t *tmp_vol = NULL;
diff --git a/xlators/mgmt/glusterd/src/glusterd-statedump.c b/xlators/mgmt/glusterd/src/glusterd-statedump.c
index a3f12d62ed2..aa866954ecd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-statedump.c
+++ b/xlators/mgmt/glusterd/src/glusterd-statedump.c
@@ -20,8 +20,8 @@ static void
glusterd_dump_peer (glusterd_peerinfo_t *peerinfo, char *input_key, int index,
gf_boolean_t xpeers)
{
- char subkey[144] = {0,};
- char key[GF_DUMP_MAX_BUF_LEN] = {0,};
+ char subkey[GF_DUMP_MAX_BUF_LEN + 11] = "";
+ char key[GF_DUMP_MAX_BUF_LEN] = "";
strncpy (key, input_key, sizeof(key) - 1);
@@ -63,9 +63,9 @@ glusterd_dump_peer_rpcstat (glusterd_peerinfo_t *peerinfo, char *input_key,
rpc_clnt_connection_t *conn = NULL;
int ret = -1;
rpc_clnt_t *rpc = NULL;
- char rpcsvc_peername[RPCSVC_PEER_STRLEN] = {0,};
- char subkey[144] = {0,};
- char key[GF_DUMP_MAX_BUF_LEN] = {0,};
+ char rpcsvc_peername[RPCSVC_PEER_STRLEN] = "";
+ char subkey[GF_DUMP_MAX_BUF_LEN + 11] = "";
+ char key[GF_DUMP_MAX_BUF_LEN] = "";
strncpy (key, input_key, sizeof(key) - 1);
@@ -106,8 +106,8 @@ static void
glusterd_dump_client_details (glusterd_conf_t *conf)
{
rpc_transport_t *xprt = NULL;
- char key[GF_DUMP_MAX_BUF_LEN] = {0,};
- char subkey[50] = {0,};
+ char key[GF_DUMP_MAX_BUF_LEN] = "";
+ char subkey[50] = "";
int index = 1;
pthread_mutex_lock (&conf->xprt_lock);
@@ -147,8 +147,8 @@ glusterd_dict_mgmt_v3_lock_statedump (dict_t *dict)
int ret = 0;
int dumplen = 0;
data_pair_t *trav = NULL;
- char key[GF_DUMP_MAX_BUF_LEN] = {0,};
- char dump[64*1024] = {0,};
+ char key[GF_DUMP_MAX_BUF_LEN] = "";
+ char dump[64*1024] = "";
if (!dict) {
gf_msg_callingfn ("glusterd", GF_LOG_WARNING, EINVAL,
@@ -186,7 +186,7 @@ int
glusterd_dump_priv (xlator_t *this)
{
glusterd_conf_t *priv = NULL;
- char key[GF_DUMP_MAX_BUF_LEN] = {0,};
+ char key[GF_DUMP_MAX_BUF_LEN] = "";
int port = 0;
struct pmap_registry *pmap = NULL;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 0f7fef65687..06d17ea5710 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -310,8 +310,8 @@ glusterd_lock (uuid_t uuid)
{
uuid_t owner;
- char new_owner_str[50];
- char owner_str[50];
+ char new_owner_str[50] = "";
+ char owner_str[50] = "";
int ret = -1;
xlator_t *this = NULL;
@@ -347,8 +347,8 @@ int32_t
glusterd_unlock (uuid_t uuid)
{
uuid_t owner;
- char new_owner_str[50];
- char owner_str[50];
+ char new_owner_str[50] = "";
+ char owner_str[50] = "";
int32_t ret = -1;
xlator_t *this = NULL;
@@ -1218,7 +1218,7 @@ glusterd_brickinfo_new_from_brick (char *brick,
int32_t ret = -1;
glusterd_brickinfo_t *new_brickinfo = NULL;
xlator_t *this = NULL;
- char abspath[PATH_MAX] = {0};
+ char abspath[PATH_MAX] = "";
this = THIS;
GF_ASSERT (this);
@@ -1360,7 +1360,7 @@ glusterd_is_brickpath_available (uuid_t uuid, char *path)
glusterd_volinfo_t *volinfo = NULL;
glusterd_conf_t *priv = NULL;
gf_boolean_t available = _gf_false;
- char tmp_path[PATH_MAX+1] = {0};
+ char tmp_path[PATH_MAX+1] = "";
priv = THIS->private;
@@ -1464,13 +1464,13 @@ glusterd_validate_and_create_brickpath (glusterd_brickinfo_t *brickinfo,
gf_boolean_t ignore_partition)
{
int ret = -1;
- char parentdir[PATH_MAX] = {0,};
+ char parentdir[PATH_MAX] = "";
struct stat parent_st = {0,};
struct stat brick_st = {0,};
struct stat root_st = {0,};
- char msg[2048] = {0,};
+ char msg[2048] = "";
gf_boolean_t is_created = _gf_false;
- char glusterfs_dir_path[PATH_MAX] = {0};
+ char glusterfs_dir_path[PATH_MAX] = "";
int32_t len = 0;
ret = sys_mkdir (brickinfo->path, 0777);
@@ -1894,12 +1894,12 @@ glusterd_set_brick_socket_filepath (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo,
char *sockpath, size_t len)
{
- char volume_dir[PATH_MAX] = {0,};
+ char volume_dir[PATH_MAX] = "";
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
int expected_file_len = 0;
- char export_path[PATH_MAX] = {0,};
- char sock_filepath[PATH_MAX] = {0,};
+ char export_path[PATH_MAX] = "";
+ char sock_filepath[PATH_MAX] = "";
int32_t slen = 0;
expected_file_len = strlen (GLUSTERD_SOCK_DIR) + strlen ("/") +
@@ -1928,7 +1928,7 @@ glusterd_brick_connect (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo, char *socketpath)
{
int ret = 0;
- char volume_id_str[64];
+ char volume_id_str[64] = "";
char *brickid = NULL;
dict_t *options = NULL;
struct rpc_clnt *rpc = NULL;
@@ -1972,7 +1972,7 @@ out:
static int
_mk_rundir_p (glusterd_volinfo_t *volinfo)
{
- char rundir[PATH_MAX] = {0,};
+ char rundir[PATH_MAX] = "";
glusterd_conf_t *priv = NULL;
xlator_t *this = NULL;
int ret = -1;
@@ -1995,19 +1995,19 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
int32_t ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
- char pidfile[PATH_MAX+1] = {0,};
- char volfile[PATH_MAX] = {0,};
+ char pidfile[PATH_MAX+1] = "";
+ char volfile[PATH_MAX] = "";
runner_t runner = {0,};
- char exp_path[PATH_MAX] = {0,};
- char logfile[PATH_MAX] = {0,};
+ char exp_path[PATH_MAX] = "";
+ char logfile[PATH_MAX] = "";
int port = 0;
int rdma_port = 0;
char *bind_address = NULL;
char *localtime_logging = NULL;
- char socketpath[PATH_MAX] = {0};
- char glusterd_uuid[1024] = {0,};
- char valgrind_logfile[PATH_MAX] = {0};
- char rdma_brick_path[PATH_MAX] = {0,};
+ char socketpath[PATH_MAX] = "";
+ char glusterd_uuid[1024] = "";
+ char valgrind_logfile[PATH_MAX] = "";
+ char rdma_brick_path[PATH_MAX] = "";
struct rpc_clnt *rpc = NULL;
rpc_clnt_connection_t *conn = NULL;
int pid = -1;
@@ -2270,8 +2270,8 @@ int32_t
glusterd_brick_unlink_socket_file (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo)
{
- char path[PATH_MAX] = {0,};
- char socketpath[PATH_MAX] = {0};
+ char path[PATH_MAX] = "";
+ char socketpath[PATH_MAX] = "";
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
@@ -2522,7 +2522,7 @@ glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo,
glusterd_conf_t *conf = NULL;
int ret = -1;
char *op_errstr = NULL;
- char pidfile[PATH_MAX] = {0,};
+ char pidfile[PATH_MAX] = "";
int last_brick = -1;
GF_ASSERT (volinfo);
@@ -2618,7 +2618,7 @@ glusterd_readin_file (const char *filepath, int *line_count)
int ret = -1;
int n = 8;
int counter = 0;
- char buffer[PATH_MAX + 256] = {0};
+ char buffer[PATH_MAX + 256] = "";
char **lines = NULL;
FILE *fp = NULL;
void *p;
@@ -2720,9 +2720,9 @@ glusterd_volume_compute_cksum (glusterd_volinfo_t *volinfo, char *cksum_path,
uint32_t cksum = 0;
int fd = -1;
int sort_fd = 0;
- char sort_filepath[PATH_MAX] = {0};
+ char sort_filepath[PATH_MAX] = "";
char *cksum_path_final = NULL;
- char buf[4096] = {0,};
+ char buf[4096] = "";
gf_boolean_t unlink_sortfile = _gf_false;
glusterd_conf_t *priv = NULL;
xlator_t *this = NULL;
@@ -2814,9 +2814,9 @@ int glusterd_compute_cksum (glusterd_volinfo_t *volinfo,
{
int ret = -1;
uint32_t cs = 0;
- char cksum_path[PATH_MAX] = {0,};
- char path[PATH_MAX] = {0,};
- char filepath[PATH_MAX] = {0,};
+ char cksum_path[PATH_MAX] = "";
+ char path[PATH_MAX] = "";
+ char filepath[PATH_MAX] = "";
glusterd_conf_t *conf = NULL;
xlator_t *this = NULL;
int32_t len1 = 0;
@@ -2868,7 +2868,7 @@ int
_add_dict_to_prdict (dict_t *this, char *key, data_t *value, void *data)
{
glusterd_dict_ctx_t *ctx = NULL;
- char optkey[512] = {0,};
+ char optkey[512] = "";
int ret = -1;
ctx = data;
@@ -2898,7 +2898,7 @@ glusterd_add_bricks_hname_path_to_dict (dict_t *dict,
{
glusterd_brickinfo_t *brickinfo = NULL;
int ret = 0;
- char key[256] = {0};
+ char key[256] = "";
int index = 0;
@@ -2929,8 +2929,8 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
char *prefix)
{
int32_t ret = -1;
- char pfx[512] = {0,};
- char key[512] = {0,};
+ char pfx[512] = "";
+ char key[512] = "";
glusterd_brickinfo_t *brickinfo = NULL;
int32_t i = 1;
char *volume_id_str = NULL;
@@ -3250,8 +3250,8 @@ glusterd_vol_add_quota_conf_to_dict (glusterd_volinfo_t *volinfo, dict_t* load,
int vol_idx, char *prefix)
{
int fd = -1;
- unsigned char buf[16] = {0};
- char key[PATH_MAX] = {0};
+ unsigned char buf[16] = "";
+ char key[PATH_MAX] = "";
int gfid_idx = 0;
int ret = -1;
xlator_t *this = NULL;
@@ -3389,7 +3389,7 @@ glusterd_compare_friend_volume (dict_t *peer_data, int32_t count,
{
int32_t ret = -1;
- char key[512] = {0,};
+ char key[512] = "";
glusterd_volinfo_t *volinfo = NULL;
char *volname = NULL;
uint32_t cksum = 0;
@@ -3531,13 +3531,13 @@ static int32_t
import_prdict_dict (dict_t *peer_data, dict_t *dst_dict, char *key_prefix,
char *value_prefix, int opt_count, char *prefix)
{
- char key[512] = {0,};
+ char key[512] = "";
int32_t ret = 0;
int i = 1;
char *opt_key = NULL;
char *opt_val = NULL;
char *dup_opt_val = NULL;
- char msg[2048] = {0};
+ char msg[2048] = "";
while (i <= opt_count) {
snprintf (key, sizeof (key), "%s.%s%d",
@@ -3603,11 +3603,11 @@ glusterd_import_friend_volume_opts (dict_t *peer_data, int count,
glusterd_volinfo_t *volinfo,
char *prefix)
{
- char key[512] = {0,};
+ char key[512] = "";
int32_t ret = -1;
int opt_count = 0;
- char msg[2048] = {0};
- char volume_prefix[1024] = {0};
+ char msg[2048] = "";
+ char volume_prefix[1024] = "";
GF_ASSERT (peer_data);
GF_ASSERT (volinfo);
@@ -3670,7 +3670,7 @@ glusterd_import_new_brick (dict_t *peer_data, int32_t vol_count,
char *brick_id = NULL;
int decommissioned = 0;
glusterd_brickinfo_t *new_brickinfo = NULL;
- char msg[2048] = {0};
+ char msg[2048] = "";
char *brick_uuid_str = NULL;
GF_ASSERT (peer_data);
@@ -3795,7 +3795,7 @@ glusterd_import_quota_conf (dict_t *peer_data, int vol_idx,
int gfid_count = 0;
int ret = -1;
int fd = -1;
- char key[PATH_MAX] = {0};
+ char key[PATH_MAX] = "";
char *gfid_str = NULL;
uuid_t gfid = {0,};
xlator_t *this = NULL;
@@ -3910,9 +3910,9 @@ gd_import_friend_volume_rebal_dict (dict_t *dict, int count,
glusterd_volinfo_t *volinfo)
{
int ret = -1;
- char key[256] = {0,};
+ char key[256] = "";
int dict_count = 0;
- char prefix[64] = {0};
+ char prefix[64] = "";
GF_ASSERT (dict);
GF_ASSERT (volinfo);
@@ -3951,12 +3951,12 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
char *prefix)
{
int ret = -1;
- char key[256] = {0};
+ char key[256] = "";
char *parent_volname = NULL;
char *volname = NULL;
glusterd_volinfo_t *new_volinfo = NULL;
char *volume_id_str = NULL;
- char msg[2048] = {0};
+ char msg[2048] = "";
char *str = NULL;
char *rebalance_id_str = NULL;
int op_version = 0;
@@ -4374,7 +4374,7 @@ glusterd_volinfo_copy_brickinfo (glusterd_volinfo_t *old_volinfo,
glusterd_conf_t *priv = NULL;
int ret = 0;
xlator_t *this = NULL;
- char abspath[PATH_MAX] = {0};
+ char abspath[PATH_MAX] = "";
GF_ASSERT (new_volinfo);
GF_ASSERT (old_volinfo);
@@ -4606,7 +4606,7 @@ glusterd_import_friend_volume (dict_t *peer_data, int count)
glusterd_volinfo_t *new_volinfo = NULL;
glusterd_svc_t *svc = NULL;
int32_t update = 0;
- char key[512] = {0,};
+ char key[512] = "";
GF_ASSERT (peer_data);
@@ -4820,7 +4820,7 @@ int
glusterd_get_next_global_opt_version_str (dict_t *opts, char **version_str)
{
int ret = -1;
- char version_string[64] = {0};
+ char version_string[64] = "";
uint32_t version = 0;
ret = glusterd_get_global_opt_version (opts, &version);
@@ -5146,12 +5146,12 @@ glusterd_add_node_to_dict (char *server, dict_t *dict, int count,
dict_t *vol_opts)
{
int ret = -1;
- char pidfile[PATH_MAX] = {0,};
+ char pidfile[PATH_MAX] = "";
gf_boolean_t running = _gf_false;
int pid = -1;
int port = 0;
glusterd_svc_t *svc = NULL;
- char key[1024] = {0,};
+ char key[1024] = "";
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
@@ -5442,8 +5442,8 @@ attach_brick_callback (struct rpc_req *req, struct iovec *iov, int count,
glusterd_volinfo_t *volinfo = NULL;
xlator_t *this = THIS;
int ret = -1;
- char pidfile1[PATH_MAX] = {0};
- char pidfile2[PATH_MAX] = {0};
+ char pidfile1[PATH_MAX] = "";
+ char pidfile2[PATH_MAX] = "";
gf_getspec_rsp rsp = {0,};
int last_brick = -1;
@@ -5634,8 +5634,8 @@ attach_brick (xlator_t *this,
glusterd_volinfo_t *other_vol)
{
glusterd_conf_t *conf = this->private;
- char pidfile1[PATH_MAX] = {0};
- char pidfile2[PATH_MAX] = {0};
+ char pidfile1[PATH_MAX] = "";
+ char pidfile2[PATH_MAX] = "";
char unslashed[PATH_MAX] = {'\0',};
char full_id[PATH_MAX] = {'\0',};
char path[PATH_MAX] = {'\0',};
@@ -5729,7 +5729,7 @@ find_compat_brick_in_vol (glusterd_conf_t *conf,
xlator_t *this = THIS;
glusterd_brickinfo_t *other_brick = NULL;
glusterd_brick_proc_t *brick_proc = NULL;
- char pidfile2[PATH_MAX] = {0};
+ char pidfile2[PATH_MAX] = "";
int32_t pid2 = -1;
int16_t retries = 15;
int mux_limit = -1;
@@ -5958,15 +5958,15 @@ find_compatible_brick (glusterd_conf_t *conf,
int
glusterd_get_sock_from_brick_pid (int pid, char *sockpath, size_t len)
{
- char fname[128] = {0,};
- char buf[1024] = {0,};
- char cmdline[2048] = {0,};
+ char fname[128] = "";
+ char buf[1024] = "";
+ char cmdline[2048] = "";
xlator_t *this = NULL;
int fd = -1;
int i = 0, j = 0;
char *ptr = NULL;
char *brptr = NULL;
- char tmpsockpath[PATH_MAX] = {0,};
+ char tmpsockpath[PATH_MAX] = "";
size_t blen = 0;
int ret = -1;
@@ -6043,7 +6043,7 @@ search_brick_path_from_proc (pid_t brick_pid, char *brickpath)
DIR *dirp = NULL;
size_t len = 0;
int fd = -1;
- char path[PATH_MAX] = {0,};
+ char path[PATH_MAX] = "";
struct dirent scratch[2] = {{0,},};
char *brick_path = NULL;
@@ -6098,8 +6098,8 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *other_brick;
glusterd_conf_t *conf = NULL;
int32_t pid = -1;
- char pidfile[PATH_MAX] = {0};
- char socketpath[PATH_MAX] = {0};
+ char pidfile[PATH_MAX] = "";
+ char socketpath[PATH_MAX] = "";
char *brickpath = NULL;
glusterd_volinfo_t *other_vol;
gf_boolean_t is_service_running = _gf_false;
@@ -6486,14 +6486,14 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
int ret = 0;
int op_ret = 0;
int ret_status = 0;
- char uuid_str[64] = {0};
+ char uuid_str[64] = "";
glusterd_volinfo_t *volinfo = NULL;
char confpath[PATH_MAX] = "";
char *op_errstr = NULL;
glusterd_conf_t *priv = NULL;
gf_boolean_t is_template_in_use = _gf_false;
gf_boolean_t is_paused = _gf_false;
- char key1[1024] = {0,};
+ char key1[1024] = "";
xlator_t *this1 = NULL;
this1 = THIS;
@@ -6894,8 +6894,8 @@ static int
glusterd_add_inode_size_to_dict (dict_t *dict, int count)
{
int ret = -1;
- char key[1024] = {0};
- char buffer[4096] = {0};
+ char key[1024] = "";
+ char buffer[4096] = "";
char *device = NULL;
char *fs_name = NULL;
char *cur_word = NULL;
@@ -7060,9 +7060,9 @@ glusterd_add_brick_mount_details (glusterd_brickinfo_t *brickinfo,
dict_t *dict, int count)
{
int ret = -1;
- char key[1024] = {0};
- char buff [PATH_MAX] = {0};
- char base_key[32] = {0};
+ char key[1024] = "";
+ char buff[PATH_MAX] = "";
+ char base_key[32] = "";
struct mntent save_entry = {0};
char *mnt_pt = NULL;
struct mntent *entry = NULL;
@@ -7161,8 +7161,8 @@ glusterd_add_brick_detail_to_dict (glusterd_volinfo_t *volinfo,
uint64_t inodes_total = 0;
uint64_t inodes_free = 0;
uint64_t block_size = 0;
- char key[1024 + 16] = {0};
- char base_key[1024] = {0};
+ char key[1024 + 16] = "";
+ char base_key[1024] = "";
struct statvfs brickstat = {0};
xlator_t *this = NULL;
@@ -7239,9 +7239,9 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
int ret = -1;
int32_t pid = -1;
- char key[1024] = {0};
- char base_key[1024] = {0};
- char pidfile[PATH_MAX] = {0};
+ char key[2048] = "";
+ char base_key[1024] = "";
+ char pidfile[PATH_MAX] = "";
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
gf_boolean_t brick_online = _gf_false;
@@ -7337,7 +7337,7 @@ glusterd_get_all_volnames (dict_t *dict)
{
int ret = -1;
int32_t vol_count = 0;
- char key[256] = {0};
+ char key[256] = "";
glusterd_volinfo_t *entry = NULL;
glusterd_conf_t *priv = NULL;
@@ -7643,9 +7643,9 @@ glusterd_is_path_in_use (char *path, gf_boolean_t *in_use, char **op_errstr)
int i = 0;
int ret = -1;
gf_boolean_t used = _gf_false;
- char dir[PATH_MAX] = {0,};
+ char dir[PATH_MAX] = "";
char *curdir = NULL;
- char msg[2048] = {0};
+ char msg[2048] = "";
char *keys[3] = {GFID_XATTR_KEY,
GF_XATTR_VOL_ID_KEY,
NULL};
@@ -7714,7 +7714,7 @@ glusterd_check_and_set_brick_xattr (char *host, char *path, uuid_t uuid,
char **op_errstr, gf_boolean_t is_force)
{
int ret = -1;
- char msg[2048] = {0,};
+ char msg[2048] = "";
gf_boolean_t in_use = _gf_false;
int flags = 0;
@@ -7768,8 +7768,8 @@ glusterd_sm_tr_log_transition_add_to_dict (dict_t *dict,
int count)
{
int ret = -1;
- char key[512] = {0};
- char timestr[64] = {0,};
+ char key[512] = "";
+ char timestr[64] = "";
char *str = NULL;
GF_ASSERT (dict);
@@ -7985,7 +7985,7 @@ glusterd_delete_brick (glusterd_volinfo_t* volinfo,
glusterd_brickinfo_t *brickinfo)
{
int ret = 0;
- char voldir[PATH_MAX] = {0,};
+ char voldir[PATH_MAX] = "";
glusterd_conf_t *priv = THIS->private;
GF_ASSERT (volinfo);
GF_ASSERT (brickinfo);
@@ -8105,7 +8105,7 @@ glusterd_start_gsync (glusterd_volinfo_t *master_vol, char *slave,
{
int32_t ret = 0;
int32_t status = 0;
- char uuid_str [64] = {0};
+ char uuid_str[64] = "";
runner_t runner = {0,};
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
@@ -8378,8 +8378,8 @@ glusterd_brick_signal (glusterd_volinfo_t *volinfo,
int ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- char pidfile_path[PATH_MAX] = {0,};
- char dumpoptions_path[PATH_MAX] = {0,};
+ char pidfile_path[PATH_MAX] = "";
+ char dumpoptions_path[PATH_MAX] = "";
FILE *pidfile = NULL;
pid_t pid = -1;
@@ -8490,15 +8490,15 @@ glusterd_nfs_statedump (char *options, int option_cnt, char **op_errstr)
int ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- char pidfile_path[PATH_MAX] = {0,};
- char path[PATH_MAX] = {0,};
+ char pidfile_path[PATH_MAX] = "";
+ char path[PATH_MAX] = "";
FILE *pidfile = NULL;
pid_t pid = -1;
- char dumpoptions_path[PATH_MAX] = {0,};
+ char dumpoptions_path[PATH_MAX] = "";
char *option = NULL;
char *tmpptr = NULL;
char *dup_options = NULL;
- char msg[256] = {0,};
+ char msg[256] = "";
this = THIS;
GF_ASSERT (this);
@@ -8574,7 +8574,7 @@ glusterd_client_statedump (char *volname, char *options, int option_cnt,
char *dup_options = NULL;
char *option = NULL;
char *tmpptr = NULL;
- char msg[256] = {0,};
+ char msg[256] = "";
char *target_ip = NULL;
char *pid = NULL;
@@ -8615,15 +8615,15 @@ glusterd_quotad_statedump (char *options, int option_cnt, char **op_errstr)
int ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- char pidfile_path[PATH_MAX] = {0,};
- char path[PATH_MAX] = {0,};
+ char pidfile_path[PATH_MAX] = "";
+ char path[PATH_MAX] = "";
FILE *pidfile = NULL;
pid_t pid = -1;
- char dumpoptions_path[PATH_MAX] = {0,};
+ char dumpoptions_path[PATH_MAX] = "";
char *option = NULL;
char *tmpptr = NULL;
char *dup_options = NULL;
- char msg[256] = {0,};
+ char msg[256] = "";
this = THIS;
GF_ASSERT (this);
@@ -8831,7 +8831,7 @@ int
glusterd_get_bitd_filepath (char *filepath, glusterd_volinfo_t *volinfo)
{
int ret = 0;
- char path[PATH_MAX] = {0,};
+ char path[PATH_MAX] = "";
glusterd_conf_t *priv = NULL;
int32_t len = 0;
@@ -8853,7 +8853,7 @@ glusterd_get_client_filepath (char *filepath, glusterd_volinfo_t *volinfo,
gf_transport_type type)
{
int ret = 0;
- char path[PATH_MAX] = {0,};
+ char path[PATH_MAX] = "";
glusterd_conf_t *priv = NULL;
int32_t len = 0;
@@ -8888,7 +8888,7 @@ glusterd_get_trusted_client_filepath (char *filepath,
gf_transport_type type)
{
int ret = 0;
- char path[PATH_MAX] = {0,};
+ char path[PATH_MAX] = "";
glusterd_conf_t *priv = NULL;
int32_t len = 0;
@@ -8976,7 +8976,7 @@ glusterd_volume_defrag_restart (glusterd_volinfo_t *volinfo, char *op_errstr,
{
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
- char pidfile[PATH_MAX] = {0,};
+ char pidfile[PATH_MAX] = "";
int ret = -1;
pid_t pid = 0;
@@ -9099,7 +9099,7 @@ int
glusterd_restart_rebalance_for_volume (glusterd_volinfo_t *volinfo)
{
int ret = -1;
- char op_errstr[PATH_MAX];
+ char op_errstr[PATH_MAX] = "";
if (!gd_should_i_start_rebalance (volinfo)) {
@@ -9622,7 +9622,7 @@ glusterd_append_gsync_status (dict_t *dst, dict_t *src)
int32_t
glusterd_append_status_dicts (dict_t *dst, dict_t *src)
{
- char sts_val_name[PATH_MAX] = {0, };
+ char sts_val_name[PATH_MAX] = "";
int dst_count = 0;
int src_count = 0;
int i = 0;
@@ -9878,11 +9878,11 @@ static int
_profile_volume_add_friend_rsp (dict_t *this, char *key, data_t *value,
void *data)
{
- char new_key[264] = {0};
+ char new_key[264] = "";
glusterd_pr_brick_rsp_conv_t *rsp_ctx = NULL;
data_t *new_value = NULL;
int brick_count = 0;
- char brick_key[256];
+ char brick_key[256] = "";
if (strcmp (key, "count") == 0)
return 0;
@@ -9942,8 +9942,8 @@ glusterd_volume_status_add_peer_rsp (dict_t *this, char *key, data_t *value,
{
glusterd_status_rsp_conv_t *rsp_ctx = NULL;
data_t *new_value = NULL;
- char brick_key[1024] = {0,};
- char new_key[1024] = {0,};
+ char brick_key[1024] = "";
+ char new_key[1024] = "";
int32_t index = 0;
int32_t ret = -1;
int32_t len = 0;
@@ -10019,7 +10019,7 @@ glusterd_volume_status_aggregate_tasks_status (dict_t *ctx_dict,
int remote_count = 0;
int i = 0;
int j = 0;
- char key[128] = {0,};
+ char key[128] = "";
char *task_type = NULL;
int local_status = 0;
int remote_status = 0;
@@ -10199,7 +10199,7 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict)
int vol_count = -1;
int i = 0;
dict_t *ctx_dict = NULL;
- char key[PATH_MAX] = {0,};
+ char key[PATH_MAX] = "";
char *volname = NULL;
glusterd_volinfo_t *volinfo = NULL;
@@ -10414,7 +10414,7 @@ glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
int ret = -1;
int j = 0;
uint64_t value = 0;
- char key[256] = {0,};
+ char key[256] = "";
char *last_scrub_time = NULL;
char *scrub_time = NULL;
char *volname = NULL;
@@ -10628,8 +10628,8 @@ glusterd_bitrot_volume_node_rsp (dict_t *aggr, dict_t *rsp_dict)
{
int ret = -1;
uint64_t value = 0;
- char key[256] = {0,};
- char buf[1024] = {0,};
+ char key[256] = "";
+ char buf[1024] = "";
int32_t i = 0;
int32_t j = 0;
char *last_scrub_time = NULL;
@@ -10837,7 +10837,7 @@ out:
int
glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
{
- char key[256] = {0,};
+ char key[256] = "";
char *node_uuid = NULL;
char *node_uuid_str = NULL;
char *volname = NULL;
@@ -11042,7 +11042,7 @@ out:
int
glusterd_volume_tier_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
{
- char key[256] = {0,};
+ char key[256] = "";
char *node_uuid = NULL;
char *node_uuid_str = NULL;
char *volname = NULL;
@@ -11358,7 +11358,7 @@ int
_profile_volume_add_brick_rsp (dict_t *this, char *key, data_t *value,
void *data)
{
- char new_key[256] = {0};
+ char new_key[256] = "";
glusterd_pr_brick_rsp_conv_t *rsp_ctx = NULL;
data_t *new_value = NULL;
@@ -11379,7 +11379,7 @@ glusterd_volume_quota_copy_to_op_ctx_dict (dict_t *dict, dict_t *rsp_dict)
int rsp_dict_count = 0;
char *uuid_str = NULL;
char *uuid_str_dup = NULL;
- char key[256] = {0,};
+ char key[256] = "";
xlator_t *this = NULL;
int type = GF_QUOTA_OPTION_TYPE_NONE;
@@ -11474,8 +11474,8 @@ glusterd_profile_volume_brick_rsp (void *pending_entry,
int ret = 0;
glusterd_pr_brick_rsp_conv_t rsp_ctx = {0};
int32_t count = 0;
- char brick[PATH_MAX+1024] = {0};
- char key[256] = {0};
+ char brick[PATH_MAX+1024] = "";
+ char key[256] = "";
char *full_brick = NULL;
glusterd_brickinfo_t *brickinfo = NULL;
xlator_t *this = NULL;
@@ -11522,8 +11522,8 @@ glusterd_profile_volume_brick_rsp (void *pending_entry,
int
_heal_volume_add_shd_rsp (dict_t *this, char *key, data_t *value, void *data)
{
- char new_key[256] = {0,};
- char int_str[16] = {0};
+ char new_key[256] = "";
+ char int_str[16] = "";
data_t *new_value = NULL;
char *rxl_end = NULL;
char *rxl_child_end = NULL;
@@ -11583,9 +11583,9 @@ int
_heal_volume_add_shd_rsp_of_statistics (dict_t *this, char *key, data_t
*value, void *data)
{
- char new_key[256] = {0,};
- char int_str[16] = {0,};
- char key_begin_string[128] = {0,};
+ char new_key[256] = "";
+ char int_str[16] = "";
+ char key_begin_string[128] = "";
data_t *new_value = NULL;
char *rxl_end = NULL;
char *rxl_child_end = NULL;
@@ -11704,7 +11704,7 @@ int
_status_volume_add_brick_rsp (dict_t *this, char *key, data_t *value,
void *data)
{
- char new_key[256] = {0,};
+ char new_key[256] = "";
data_t *new_value = 0;
glusterd_pr_brick_rsp_conv_t *rsp_ctx = NULL;
@@ -11769,7 +11769,7 @@ glusterd_status_volume_client_list (dict_t *rsp_dict, dict_t *op_ctx,
int32_t snapd_count = 0;
int32_t client_count = 0;
int i = 0;
- char key[256] = {0,};
+ char key[256] = "";
GF_ASSERT (rsp_dict);
GF_ASSERT (op_ctx);
@@ -11957,7 +11957,7 @@ int
glusterd_tier_or_rebalance_rsp (dict_t *op_ctx, glusterd_rebalance_t *index, int32_t i)
{
int ret = 0;
- char key[256] = {0,};
+ char key[256] = "";
snprintf (key, sizeof (key), "files-%d", i);
ret = dict_set_uint64 (op_ctx, key, index->rebalance_files);
@@ -12018,9 +12018,9 @@ glusterd_defrag_volume_node_rsp (dict_t *req_dict, dict_t *rsp_dict,
int ret = 0;
char *volname = NULL;
glusterd_volinfo_t *volinfo = NULL;
- char key[256] = {0,};
+ char key[256] = "";
int32_t i = 0;
- char buf[1024] = {0,};
+ char buf[1024] = "";
char *node_str = NULL;
int32_t cmd = 0;
@@ -12254,7 +12254,7 @@ int
glusterd_copy_uuid_to_dict (uuid_t uuid, dict_t *dict, char *key)
{
int ret = -1;
- char tmp_str[40] = {0,};
+ char tmp_str[40] = "";
char *task_id_str = NULL;
GF_ASSERT (dict);
@@ -12435,7 +12435,7 @@ gd_should_i_start_rebalance (glusterd_volinfo_t *volinfo) {
glusterd_brickinfo_t *brick = NULL;
int count = 0;
int i = 0;
- char key[1023] = {0,};
+ char key[1023] = "";
char *brickname = NULL;
@@ -12525,7 +12525,7 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
uuid_t uuid1 = {0};
uuid_t uuid2 = {0,};
char *path = NULL;
- char key[256] = {0,};
+ char key[256] = "";
char *uuid1_str = NULL;
char *uuid1_str_dup = NULL;
char *uuid2_str = NULL;
@@ -12653,9 +12653,9 @@ out:
void
glusterd_clean_up_quota_store (glusterd_volinfo_t *volinfo)
{
- char voldir[PATH_MAX] = {0,};
- char quota_confpath[PATH_MAX] = {0,};
- char cksum_path[PATH_MAX] = {0,};
+ char voldir[PATH_MAX] = "";
+ char quota_confpath[PATH_MAX] = "";
+ char cksum_path[PATH_MAX] = "";
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
int32_t len = 0;
@@ -12691,7 +12691,7 @@ int
glusterd_remove_auxiliary_mount (char *volname)
{
int ret = -1;
- char mountdir[PATH_MAX] = {0,};
+ char mountdir[PATH_MAX] = "";
xlator_t *this = NULL;
this = THIS;
@@ -12720,7 +12720,7 @@ gd_stop_rebalance_process (glusterd_volinfo_t *volinfo)
int ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- char pidfile[PATH_MAX] = {0,};
+ char pidfile[PATH_MAX] = "";
GF_ASSERT (volinfo);
@@ -12901,7 +12901,7 @@ void
glusterd_get_gfproxy_client_volfile (glusterd_volinfo_t *volinfo,
char *path, int path_len)
{
- char workdir[PATH_MAX] = {0, };
+ char workdir[PATH_MAX] = "";
glusterd_conf_t *priv = THIS->private;
GLUSTERD_GET_VOLUME_DIR (workdir, volinfo, priv);
@@ -12927,7 +12927,7 @@ void
glusterd_get_rebalance_volfile (glusterd_volinfo_t *volinfo,
char *path, int path_len)
{
- char workdir[PATH_MAX] = {0,};
+ char workdir[PATH_MAX] = "";
glusterd_conf_t *priv = THIS->private;
GLUSTERD_GET_VOLUME_DIR (workdir, volinfo, priv);
@@ -13066,7 +13066,7 @@ glusterd_get_global_max_op_version (rpcsvc_request_t *req, dict_t *ctx,
{
int ret = -1;
char *def_val = NULL;
- char dict_key[50] = {0,};
+ char dict_key[50] = "";
ret = glusterd_mgmt_v3_initiate_all_phases (req, GD_OP_MAX_OPVERSION,
ctx);
@@ -13115,9 +13115,9 @@ glusterd_get_global_options_for_all_vols (rpcsvc_request_t *req, dict_t *ctx,
xlator_t *this = NULL;
char *key = NULL;
char *key_fixed = NULL;
- char dict_key[50] = {0,};
+ char dict_key[50] = "";
char *def_val = NULL;
- char err_str[PATH_MAX] = {0,};
+ char err_str[PATH_MAX] = "";
char *allvolopt = NULL;
int32_t i = 0;
gf_boolean_t exists = _gf_false;
@@ -13272,7 +13272,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
char err_str[PATH_MAX] = "";
xlator_t *this = NULL;
char *def_val = NULL;
- char dict_key[50] = {0,};
+ char dict_key[50] = "";
gf_boolean_t key_found = _gf_false;
glusterd_conf_t *priv = NULL;
dict_t *vol_dict = NULL;
@@ -13941,12 +13941,12 @@ glusterd_handle_replicate_brick_ops (glusterd_volinfo_t *volinfo,
{
int32_t ret = -1;
char tmpmount[] = "/tmp/mntXXXXXX";
- char logfile[PATH_MAX] = {0,};
+ char logfile[PATH_MAX] = "";
int dirty[3] = {0,};
runner_t runner = {0};
glusterd_conf_t *priv = NULL;
char *pid = NULL;
- char vpath[PATH_MAX] = {0,};
+ char vpath[PATH_MAX] = "";
char *volfileserver = NULL;
priv = THIS->private;
@@ -14153,7 +14153,7 @@ glusterd_brick_op_prerequisites (dict_t *dict,
char **op_errstr, dict_t *rsp_dict)
{
int ret = 0;
- char msg[2048] = {0};
+ char msg[2048] = "";
gsync_status_param_t param = {0,};
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
@@ -14299,7 +14299,7 @@ glusterd_get_dst_brick_info (char **dst_brick, char *volname, char **op_errstr,
char *path = NULL;
char *c = NULL;
- char msg[2048] = {0};
+ char msg[2048] = "";
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
int ret = 0;