summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.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/common-utils.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/common-utils.c')
-rw-r--r--libglusterfs/src/common-utils.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 2d4415f506d..e7d54d48b22 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -357,6 +357,9 @@ gf_print_trace (int32_t signum)
/* Pending frames, (if any), list them in order */
ret = write (fd, "pending frames:\n", 16);
+ if (ret < 0)
+ goto out;
+
{
glusterfs_ctx_t *ctx = glusterfs_ctx_get ();
struct list_head *trav = ((call_pool_t *)ctx->pool)->all_frames.next;
@@ -372,16 +375,25 @@ gf_print_trace (int32_t signum)
gf_mgmt_list[tmp->root->op]);
ret = write (fd, msg, strlen (msg));
+ if (ret < 0)
+ goto out;
+
trav = trav->next;
}
ret = write (fd, "\n", 1);
+ if (ret < 0)
+ goto out;
}
sprintf (msg, "patchset: %s\n", GLUSTERFS_REPOSITORY_REVISION);
ret = write (fd, msg, strlen (msg));
+ if (ret < 0)
+ goto out;
sprintf (msg, "signal received: %d\n", signum);
ret = write (fd, msg, strlen (msg));
+ if (ret < 0)
+ goto out;
{
/* Dump the timestamp of the crash too, so the previous logs
@@ -390,7 +402,11 @@ gf_print_trace (int32_t signum)
tm = localtime (&utime);
strftime (timestr, 256, "%Y-%m-%d %H:%M:%S\n", tm);
ret = write (fd, "time of crash: ", 15);
+ if (ret < 0)
+ goto out;
ret = write (fd, timestr, strlen (timestr));
+ if (ret < 0)
+ goto out;
}
gf_dump_config_flags (fd);
@@ -404,9 +420,12 @@ gf_print_trace (int32_t signum)
backtrace_symbols_fd (&array[1], size-1, fd);
sprintf (msg, "---------\n");
ret = write (fd, msg, strlen (msg));
+ if (ret < 0)
+ goto out;
}
#endif /* HAVE_BACKTRACE */
+out:
/* Send a signal to terminate the process */
signal (signum, SIG_DFL);
raise (signum);