diff options
Diffstat (limited to 'tools/hv/hv_vss_daemon.c')
| -rw-r--r-- | tools/hv/hv_vss_daemon.c | 11 | 
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index 8611962c672..6a213b8cd7b 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c @@ -22,7 +22,6 @@  #include <sys/socket.h>  #include <sys/poll.h>  #include <sys/ioctl.h> -#include <linux/types.h>  #include <fcntl.h>  #include <stdio.h>  #include <mntent.h> @@ -88,6 +87,8 @@ static int vss_operate(int operation)  			continue;  		if (strcmp(ent->mnt_type, "iso9660") == 0)  			continue; +		if (strcmp(ent->mnt_type, "vfat") == 0) +			continue;  		if (strcmp(ent->mnt_dir, "/") == 0) {  			root_seen = 1;  			continue; @@ -140,7 +141,6 @@ int main(void)  	struct cn_msg	*incoming_cn_msg;  	int	op;  	struct hv_vss_msg *vss_msg; -	char *vss_send_buffer;  	char *vss_recv_buffer;  	size_t vss_recv_buffer_len; @@ -150,10 +150,9 @@ int main(void)  	openlog("Hyper-V VSS", 0, LOG_USER);  	syslog(LOG_INFO, "VSS starting; pid is:%d", getpid()); -	vss_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + sizeof(struct hv_vss_msg); -	vss_send_buffer = calloc(1, vss_recv_buffer_len); +	vss_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + sizeof(struct hv_vss_msg);  	vss_recv_buffer = calloc(1, vss_recv_buffer_len); -	if (!(vss_send_buffer && vss_recv_buffer)) { +	if (!vss_recv_buffer) {  		syslog(LOG_ERR, "Failed to allocate netlink buffers");  		exit(EXIT_FAILURE);  	} @@ -185,7 +184,7 @@ int main(void)  	/*  	 * Register ourselves with the kernel.  	 */ -	message = (struct cn_msg *)vss_send_buffer; +	message = (struct cn_msg *)vss_recv_buffer;  	message->id.idx = CN_VSS_IDX;  	message->id.val = CN_VSS_VAL;  	message->ack = 0;  | 
