summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-protocol.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-07-17 22:43:19 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-20 14:29:08 -0700
commit793ca3c52a9ba6a1723e5ad767449f8b69ac19a8 (patch)
treeeda10664de3eb435e1f19542644bdfc24e172ef2 /xlators/protocol/client/src/client-protocol.c
parent05211cdaff7ac117095c2213722b386c0f172ed0 (diff)
fix build warnings in 'client-protocol'
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 130 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130
Diffstat (limited to 'xlators/protocol/client/src/client-protocol.c')
-rw-r--r--xlators/protocol/client/src/client-protocol.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index 599872456e0..bbeffaa1e0d 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -3274,11 +3274,18 @@ client_setdents (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags,
uint32_t mtime_nsec = ST_MTIM_NSEC(stbuf);
uint32_t ctime_nsec = ST_CTIM_NSEC(stbuf);
- asprintf (&tmp_buf, GF_STAT_PRINT_FMT_STR,
- dev, ino, mode, nlink, uid, gid,
- rdev, size, blksize, blocks,
- atime, atime_nsec, mtime, mtime_nsec,
- ctime, ctime_nsec);
+ ret = asprintf (&tmp_buf, GF_STAT_PRINT_FMT_STR,
+ dev, ino, mode, nlink, uid, gid,
+ rdev, size, blksize, blocks,
+ atime, atime_nsec, mtime, mtime_nsec,
+ ctime, ctime_nsec);
+ if (-1 == ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "asprintf failed while setting stat "
+ "buf to string");
+ STACK_UNWIND (frame, -1, ENOMEM);
+ return 0;
+ }
}
this_len = sprintf (ptr, "%s/%s%s\n",
trav->name, tmp_buf, trav->link);
@@ -5968,8 +5975,13 @@ protocol_client_handshake (xlator_t *this, transport_t *trans)
GF_PROTOCOL_VERSION);
}
- asprintf (&process_uuid_xl, "%s-%s", this->ctx->process_uuid,
- this->name);
+ ret = asprintf (&process_uuid_xl, "%s-%s", this->ctx->process_uuid,
+ this->name);
+ if (-1 == ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "asprintf failed while setting process_uuid");
+ goto fail;
+ }
ret = dict_set_dynstr (options, "process-uuid",
process_uuid_xl);
if (ret < 0) {