* [Qemu-devel] PATCH: remove "control reaches end of non-void function" warnings
@ 2004-09-14 19:29 Pavel Janík
0 siblings, 0 replies; only message in thread
From: Pavel Janík @ 2004-09-14 19:29 UTC (permalink / raw)
To: qemu-devel
Hi,
the current CVS code doesn't return values in block driver's close
functions although close is defined to return int. No code currently check
for return value, but I think it is better to return value instead of being
void.
Please apply the attached patch which changes close functions
implementations so that they return the value returned by close system
call.
Index: block-cow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-cow.c,v
retrieving revision 1.2
diff -u -r1.2 block-cow.c
--- block-cow.c 3 Aug 2004 21:13:54 -0000 1.2
+++ block-cow.c 14 Sep 2004 19:27:07 -0000
@@ -206,7 +206,7 @@
{
BDRVCowState *s = bs->opaque;
munmap(s->cow_bitmap_addr, s->cow_bitmap_size);
- close(s->fd);
+ return close(s->fd);
}
static int cow_create(const char *filename, int64_t image_sectors,
Index: block-qcow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-qcow.c,v
retrieving revision 1.2
diff -u -r1.2 block-qcow.c
--- block-qcow.c 3 Aug 2004 21:13:54 -0000 1.2
+++ block-qcow.c 14 Sep 2004 19:27:10 -0000
@@ -528,7 +528,7 @@
qemu_free(s->l2_cache);
qemu_free(s->cluster_cache);
qemu_free(s->cluster_data);
- close(s->fd);
+ return close(s->fd);
}
static int qcow_create(const char *filename, int64_t total_size,
Index: block-vmdk.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-vmdk.c,v
retrieving revision 1.3
diff -u -r1.3 block-vmdk.c
--- block-vmdk.c 25 Aug 2004 20:50:14 -0000 1.3
+++ block-vmdk.c 14 Sep 2004 19:27:10 -0000
@@ -263,7 +263,7 @@
BDRVVmdkState *s = bs->opaque;
qemu_free(s->l1_table);
qemu_free(s->l2_cache);
- close(s->fd);
+ return close(s->fd);
}
BlockDriver bdrv_vmdk = {
Index: block.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block.c,v
retrieving revision 1.12
diff -u -r1.12 block.c
--- block.c 3 Aug 2004 21:14:09 -0000 1.12
+++ block.c 14 Sep 2004 19:27:11 -0000
@@ -557,7 +557,7 @@
static int raw_close(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
- close(s->fd);
+ return close(s->fd);
}
static int raw_create(const char *filename, int64_t total_size,
--
Pavel Janík
... oving vim, hating vi."
-- Gerhard Haring in python-list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-14 19:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-14 19:29 [Qemu-devel] PATCH: remove "control reaches end of non-void function" warnings Pavel Janík
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.