From 84ebee8c20ce667a5ec5fddc0aa47f8b5bef39f8 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 18 Oct 2011 10:30:42 +0530 Subject: 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 Reviewed-by: Anand Avati --- libglusterfs/src/common-utils.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libglusterfs/src/common-utils.c') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 2d4415f50..e7d54d48b 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); -- cgit