summaryrefslogtreecommitdiffstats
path: root/contrib/fuse-lib
diff options
context:
space:
mode:
authorVenky Shankar <venky@gluster.com>2011-04-11 05:48:36 +0000
committerAnand Avati <avati@gluster.com>2011-04-11 23:50:28 -0700
commit2a6598646824da9d6a957fb5b3e4c6bb40fb6835 (patch)
tree2a432e056f4803967569f58f2d70e9c63e2ef306 /contrib/fuse-lib
parentcfd85789c44ce3f88d6bf87d7b0a47dafb8c6d57 (diff)
build fixes
Signed-off-by: Venky Shankar <venky@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2550 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2550
Diffstat (limited to 'contrib/fuse-lib')
-rw-r--r--contrib/fuse-lib/mount.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c
index 59f5837ed40..47592a62dd8 100644
--- a/contrib/fuse-lib/mount.c
+++ b/contrib/fuse-lib/mount.c
@@ -261,6 +261,7 @@ receive_fd (int fd)
int rv;
size_t ccmsg[CMSG_SPACE (sizeof (int)) / sizeof (size_t)];
struct cmsghdr *cmsg;
+ int *recv_fd;
iov.iov_base = buf;
iov.iov_len = 1;
@@ -285,12 +286,17 @@ receive_fd (int fd)
}
cmsg = CMSG_FIRSTHDR (&msg);
- if (!cmsg->cmsg_type == SCM_RIGHTS) {
+ /*
+ * simplify condition expression
+ */
+ if (cmsg->cmsg_type != SCM_RIGHTS) {
GFFUSE_LOGERR ("got control message of unknown type %d",
cmsg->cmsg_type);
return -1;
}
- return *(int*)CMSG_DATA (cmsg);
+
+ recv_fd = (int *) CMSG_DATA (cmsg);
+ return (*recv_fd);
}
static int