[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 08 of 18] tools/blktap2: fix build errors caused by Werror in tdqcow_get_parent_id
# HG changeset patch # User Olaf Hering <olaf@xxxxxxxxx> # Date 1333397540 -7200 # Node ID e9b9e8254311fb61930ab5a954e777928466c607 # Parent acb561c6d4d8ebee95ad0e7007f99a2d22dbaa34 tools/blktap2: fix build errors caused by Werror in tdqcow_get_parent_id -O2 -Wall -Werror triggers these warnings: block-qcow.c: In function 'tdqcow_get_parent_id': block-qcow.c:1457:17: warning: 'type' may be used uninitialized in this function [-Wuninitialized] The compiler can not know that open() writes to errno so it has to assume that errno can be zero. Use assert as hint for gcc. v2: - add assert() as suggested by IanJ Signed-off-by: Olaf Hering <olaf@xxxxxxxxx> diff -r acb561c6d4d8 -r e9b9e8254311 tools/blktap2/drivers/block-qcow.c --- a/tools/blktap2/drivers/block-qcow.c +++ b/tools/blktap2/drivers/block-qcow.c @@ -34,6 +34,7 @@ #include <inttypes.h> #include <libaio.h> #include <limits.h> +#include <assert.h> #include "bswap.h" #include "aes.h" #include "md5.h" @@ -1407,8 +1408,10 @@ tdqcow_get_image_type(const char *file, QCowHeader header; fd = open(file, O_RDONLY); - if (fd == -1) + if (fd == -1) { + assert(errno); return -errno; + } size = read(fd, &header, sizeof(header)); close(fd); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |