From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C7J6d-000547-Gr for qemu-devel@nongnu.org; Tue, 14 Sep 2004 15:36:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C7J6b-00053v-Vk for qemu-devel@nongnu.org; Tue, 14 Sep 2004 15:36:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7J6b-00053s-Te for qemu-devel@nongnu.org; Tue, 14 Sep 2004 15:36:45 -0400 Received: from [195.122.192.2] (helo=janik.cz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C7J0T-0005jX-DC for qemu-devel@nongnu.org; Tue, 14 Sep 2004 15:30:26 -0400 From: Pavel@Janik.cz (=?iso-8859-2?q?Pavel_Jan=EDk?=) Date: Tue, 14 Sep 2004 21:29:57 +0200 Message-ID: <874qm0odhm.fsf@Janik.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] PATCH: remove "control reaches end of non-void function" warnings Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 chec= k for return value, but I think it is better to return value instead of bei= ng 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D bs->opaque; munmap(s->cow_bitmap_addr, s->cow_bitmap_size); - close(s->fd); + return close(s->fd); } =20 static int cow_create(const char *filename, int64_t image_sectors, Index: block-qcow.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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); } =20 static int qcow_create(const char *filename, int64_t total_size, Index: block-vmdk.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D bs->opaque; qemu_free(s->l1_table); qemu_free(s->l2_cache); - close(s->fd); + return close(s->fd); } =20 BlockDriver bdrv_vmdk =3D { Index: block.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D bs->opaque; - close(s->fd); + return close(s->fd); } =20 static int raw_create(const char *filename, int64_t total_size, --=20 Pavel Jan=EDk ... oving vim, hating vi." -- Gerhard Haring in python-list