summaryrefslogtreecommitdiffstats
path: root/daemons/cmirrord/local.c
diff options
context:
space:
mode:
authorJonathan Earl Brassow <jbrassow@redhat.com>2010-01-18 20:58:50 +0000
committerJonathan Earl Brassow <jbrassow@redhat.com>2010-01-18 20:58:50 +0000
commit98998134de36c7faa8e09acfffa5f585edf07ce7 (patch)
treee563e70a984588016445c17442cb0e87653a9b5b /daemons/cmirrord/local.c
parent3c4310d6ef6eda0ee8395116daa4fa26c3d5512d (diff)
downloadlvm2-98998134de36c7faa8e09acfffa5f585edf07ce7.tar.gz
lvm2-98998134de36c7faa8e09acfffa5f585edf07ce7.tar.xz
lvm2-98998134de36c7faa8e09acfffa5f585edf07ce7.zip
Fix some compiler warnings.
Diffstat (limited to 'daemons/cmirrord/local.c')
-rw-r--r--daemons/cmirrord/local.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/daemons/cmirrord/local.c b/daemons/cmirrord/local.c
index 6e17697a..a4bbd8f5 100644
--- a/daemons/cmirrord/local.c
+++ b/daemons/cmirrord/local.c
@@ -89,8 +89,10 @@ static int kernel_recv(struct clog_request **rq)
{
int r = 0;
int len;
+ void *foo;
struct cn_msg *msg;
struct dm_ulog_request *u_rq;
+ struct nlmsghdr *nlmsg_h;
*rq = NULL;
memset(recv_buf, 0, sizeof(recv_buf));
@@ -102,7 +104,8 @@ static int kernel_recv(struct clog_request **rq)
goto fail;
}
- switch (((struct nlmsghdr *)recv_buf)->nlmsg_type) {
+ nlmsg_h = (struct nlmsghdr *)recv_buf;
+ switch (nlmsg_h->nlmsg_type) {
case NLMSG_ERROR:
LOG_ERROR("Unable to recv message from kernel: NLMSG_ERROR");
r = -EBADE;
@@ -158,10 +161,9 @@ static int kernel_recv(struct clog_request **rq)
* beyond what is available to us, but we need only check it
* once... perhaps at compile time?
*/
-// *rq = container_of(u_rq, struct clog_request, u_rq);
- *rq = (char *)u_rq -
- (sizeof(struct clog_request) -
- sizeof(struct dm_ulog_request));
+ foo = u_rq;
+ foo -= (sizeof(struct clog_request) - sizeof(struct dm_ulog_request));
+ *rq = foo;
/* Clear the wrapper container fields */
memset(*rq, 0, (char *)u_rq - (char *)(*rq));