summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/statedump.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-10-18 10:30:42 +0530
committerAnand Avati <avati@gluster.com>2011-10-20 04:13:50 -0700
commit84ebee8c20ce667a5ec5fddc0aa47f8b5bef39f8 (patch)
treef38e977ced3c0b2d6e8c47d3aeeea4bdc3fce208 /libglusterfs/src/statedump.c
parent26a51e5e6ec1639a7601c0fc373fd9f6493b014a (diff)
build: warning suppression (round n)
with this patch, there are no more warnings with gcc (GCC) 4.6.1 20110908 Change-Id: Ice0d52d304b9846395f8a4a191c98eb53125f792 BUG: 2550 Reviewed-on: http://review.gluster.com/607 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'libglusterfs/src/statedump.c')
-rw-r--r--libglusterfs/src/statedump.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 52de73b50e3..c744c6c5ff8 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -88,13 +88,12 @@ gf_proc_dump_close (void)
}
-void
+int
gf_proc_dump_add_section (char *key, ...)
{
char buf[GF_DUMP_MAX_BUF_LEN];
va_list ap;
- int ret;
GF_ASSERT(key);
@@ -106,18 +105,17 @@ gf_proc_dump_add_section (char *key, ...)
va_end (ap);
snprintf (buf + strlen(buf),
GF_DUMP_MAX_BUF_LEN - strlen (buf), "]\n");
- ret = write (gf_dump_fd, buf, strlen (buf));
+ return write (gf_dump_fd, buf, strlen (buf));
}
-void
+int
gf_proc_dump_write (char *key, char *value,...)
{
char buf[GF_DUMP_MAX_BUF_LEN];
int offset = 0;
va_list ap;
- int ret;
GF_ASSERT (key);
@@ -133,7 +131,7 @@ gf_proc_dump_write (char *key, char *value,...)
offset = strlen (buf);
snprintf (buf + offset, GF_DUMP_MAX_BUF_LEN - offset, "\n");
- ret = write (gf_dump_fd, buf, strlen (buf));
+ return write (gf_dump_fd, buf, strlen (buf));
}
static void
@@ -421,7 +419,12 @@ gf_proc_dump_parse_set_option (char *key, char *value)
"matched key : %s\n", key);
ret = write (gf_dump_fd, buf, strlen (buf));
- return -1;
+ /* warning suppression */
+ if (ret >= 0) {
+ ret = -1;
+ goto out;
+ }
+
}
opt_value = (strncasecmp (value, "yes", 3) ?
@@ -429,7 +432,9 @@ gf_proc_dump_parse_set_option (char *key, char *value)
GF_PROC_DUMP_SET_OPTION (*opt_key, opt_value);
- return 0;
+ ret = 0;
+out:
+ return ret;
}
static int