summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-05-15 00:15:52 -0700
committerAnand Avati <avati@redhat.com>2014-05-17 11:52:53 -0700
commitaa85de4be3f96a140a69170330293bfdfa3d24e7 (patch)
tree8ae6a10aa4b850492aa3cd109db5150e63aa9667 /xlators
parentf4a391e5a44950b0468af082255b9f5abf52b10b (diff)
contrib: Cross platform fixes after recent commits
- provide a getment_r () version which behaves as re-entrant with some caveats for NetBSD/OSX specific. - some apparent warning issues fixed, always use PRI* format specification avoid using %ld i.e not portable Change-Id: Ib3d1a73b426e38b436b356355b97db0104a1a4a5 BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7722 Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c14
2 files changed, 10 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index e47f85f7ff4..e4aa838acaf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -1272,7 +1272,7 @@ glusterd_snap_create_pre_val_use_rsp_dict (dict_t *dst, dict_t *src)
}
snprintf (key, sizeof (key),
- "vol%ld.brick%ld.status", i+1, brick_order);
+ "vol%"PRId64".brick%"PRId64".status", i+1, brick_order);
ret = dict_get_int32 (src, key, &brick_online);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "failed to "
@@ -1700,7 +1700,7 @@ glusterd_snapshot_create_prevalidate (dict_t *dict, char **op_errstr,
goto out;
}
- snprintf (key, sizeof (key), "vol%ld.brick%ld.status",
+ snprintf (key, sizeof (key), "vol%"PRId64".brick%"PRId64".status",
i, brick_order);
ret = glusterd_add_brick_status_to_dict (rsp_dict,
@@ -3720,7 +3720,7 @@ glusterd_add_brick_to_snap_volume (dict_t *dict, dict_t *rsp_dict,
GF_ASSERT (snap_vol);
GF_ASSERT (original_brickinfo);
- snprintf (key, sizeof(key), "vol%ld.origin_brickpath%d",
+ snprintf (key, sizeof(key), "vol%"PRId64".origin_brickpath%d",
volcount, brick_count);
ret = dict_set_dynstr_with_alloc (dict, key, original_brickinfo->path);
if (ret) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 4615a12fa6f..8d23f4a29b0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4329,7 +4329,7 @@ glusterd_volinfo_stop_stale_bricks (glusterd_volinfo_t *new_volinfo,
ret = glusterd_brick_stop (old_volinfo, old_brickinfo,
_gf_false);
if (ret)
- gf_msg ("glusterd", GF_LOG_ERROR, 0,
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
GD_MSG_BRICK_STOP_FAIL, "Failed to stop"
" brick %s:%s", old_brickinfo->hostname,
old_brickinfo->path);
@@ -10369,7 +10369,7 @@ glusterd_merge_brick_status (dict_t *dst, dict_t *src)
for (index = 0; index < volume_count; index++) {
ret = snprintf (snapbrckcnt, sizeof(snapbrckcnt) - 1,
- "snap-vol%ld_brickcount", index+1);
+ "snap-vol%"PRId64"_brickcount", index+1);
ret = dict_get_int64 (src, snapbrckcnt, &brick_count);
if (ret) {
gf_log (this->name, GF_LOG_TRACE,
@@ -10381,7 +10381,7 @@ glusterd_merge_brick_status (dict_t *dst, dict_t *src)
for (j = 0; j < brick_count; j++) {
/* Fetching data from source dict */
snprintf (snapbrckord, sizeof(snapbrckord) - 1,
- "snap-vol%ld.brick%ld.order", index+1, j);
+ "snap-vol%"PRId64".brick%"PRId64".order", index+1, j);
ret = dict_get_int64 (src, snapbrckord, &brick_order);
if (ret) {
@@ -10392,7 +10392,7 @@ glusterd_merge_brick_status (dict_t *dst, dict_t *src)
}
snprintf (key, sizeof (key) - 1,
- "snap-vol%ld.brick%ld.status", index+1,
+ "snap-vol%"PRId64".brick%"PRId64".status", index+1,
brick_order);
ret = dict_get_int32 (src, key, &brick_online);
if (ret) {
@@ -12478,7 +12478,7 @@ glusterd_volume_quorum_check (glusterd_volinfo_t *volinfo, int64_t index,
with replica count 2, quorum is not met if even
one of its subvolumes is down
*/
- snprintf (key, sizeof (key), "%s%ld.brick%ld.status",
+ snprintf (key, sizeof (key), "%s%"PRId64".brick%"PRId64".status",
key_prefix, index, i);
ret = dict_get_int32 (dict, key, &brick_online);
if (ret || !brick_online) {
@@ -12505,7 +12505,7 @@ glusterd_volume_quorum_check (glusterd_volinfo_t *volinfo, int64_t index,
quorum_met = _gf_false;
for (i = 0; i < volinfo->replica_count; i++) {
snprintf (key, sizeof (key),
- "%s%ld.brick%ld.status", key_prefix,
+ "%s%"PRId64".brick%"PRId64".status", key_prefix,
index,
(j * volinfo->replica_count) + i);
ret = dict_get_int32 (dict, key, &brick_online);
@@ -12620,7 +12620,7 @@ glusterd_snap_quorum_check_for_create (dict_t *dict, gf_boolean_t snap_volume,
}
for (i = 1; i <= volcount; i++) {
- snprintf (key, sizeof (key), "%s%ld",
+ snprintf (key, sizeof (key), "%s%"PRId64,
snap_volume?"snap-volname":"volname", i);
ret = dict_get_str (dict, key, &volname);
if (ret) {