All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel@Janik.cz (Pavel Janík)
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] PATCH: remove "control reaches end of non-void function" warnings
Date: Tue, 14 Sep 2004 21:29:57 +0200	[thread overview]
Message-ID: <874qm0odhm.fsf@Janik.cz> (raw)

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

                 reply	other threads:[~2004-09-14 19:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874qm0odhm.fsf@Janik.cz \
    --to=pavel@janik.cz \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.