]> xenbits.xensource.com Git - people/dstodden/blktap.git/commitdiff
Make blktap portable to Ubuntu
authorMike McClurg <mike.mcclurg@citrix.com>
Tue, 7 Jun 2011 18:35:30 +0000 (19:35 +0100)
committerMike McClurg <mike.mcclurg@citrix.com>
Tue, 7 Jun 2011 18:35:30 +0000 (19:35 +0100)
These are changes mostly required by gcc 4.5, with the exception of the change
to Config.mk, which inserts some make variables that we expect to be inserted
by the spec file. The rest of the changes are including missing headers,
initialising a variable and providing a mode when opening a file.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Config.mk
drivers/tapdisk-blktap.c
drivers/tapdisk-vbd.c
vhd/lib/libvhd-index.c
vhd/lib/libvhd.c
vhd/lib/vhd-util-check.c
vhd/lib/vhd-util-scan.c

index 9c298e215de30391c0414e4a7cc2d3e233d85e89..2fea37fe3f059fcdcc31d50dd20b584489a2e046 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -13,6 +13,8 @@ CONFIG_$(BLKTAP_OS) := y
 SHELL     ?= /bin/sh
 
 DESTDIR     ?= /
+SBINDIR     ?= usr/sbin
+SYSCONFDIR  ?= etc
 
 include $(BLKTAP_ROOT)/config/$(BLKTAP_OS).mk
 include $(BLKTAP_ROOT)/config/$(BLKTAP_TARGET_ARCH).mk
index 1516f39638f193c1ebd23e63123df64de0b2bf6d..334a60f3cbd98c5cd82a2898220d5d45a39d2462 100644 (file)
@@ -35,6 +35,8 @@
 #include <limits.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 
 #include "blktap.h"
 #include "tapdisk-vbd.h"
index 708be9dd2685d391631dfcaf4bbc973349ae1db5..18d098bd29ce8cf1ed86f9d94e510b03a83b5548 100644 (file)
@@ -327,7 +327,7 @@ static void signal_enospc(td_vbd_t *vbd)
                return;
        }
 
-       fd = open(fn, O_WRONLY | O_CREAT | O_NONBLOCK);
+       fd = open(fn, O_WRONLY | O_CREAT | O_NONBLOCK, 0666);
        if (fd == -1)
                EPRINTF("Failed to open file to signal ENOSPC condition\n");
        else
index b4abdf6661109a57b80f0dd9df26f3af3c787e8e..6616218b4c20896f03a82fc337b7daa052f8ec5b 100644 (file)
@@ -35,6 +35,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <libgen.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "libvhd.h"
 #include "libvhd-index.h"
index f73bc545a4321f68b2c7b70ea15ae63f8020e6ed..dc15f0faecf1a1579bd51251a4300f43fa181740 100644 (file)
@@ -40,6 +40,8 @@
 #include <libgen.h>
 #include <iconv.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "libvhd.h"
 #include "relative-path.h"
index 0ade510ea87300aa40fae8fc0fc0af9c999f37f1..e2955d65aa68905437180cbc5dcba137188e05cb 100644 (file)
@@ -1066,6 +1066,7 @@ vhd_util_check_vhd(struct vhd_util_check_ctx *ctx, const char *name)
 
        fd = -1;
        memset(&vhd, 0, sizeof(vhd));
+       memset(&footer, 0, sizeof(footer));
 
        err = stat(name, &stats);
        if (err == -1) {
index dfc70c49adcc4db36212acb81c6c5c3e46393127..e753c136ce6a09cd7076a0dbe7f7a04d81a143e7 100644 (file)
@@ -37,6 +37,8 @@
 #include <unistd.h>
 #include <fnmatch.h>
 #include <syslog.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "list.h"
 #include "libvhd.h"