diff mbox

[-V3,3/8] hw/9pfs: Use v9fs_do_close instead of close

Message ID 1299347533-17047-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com
State New
Headers show

Commit Message

Aneesh Kumar K.V March 5, 2011, 5:52 p.m. UTC
we should use the local abstraction instead of
directly calling close.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 hw/9pfs/virtio-9p.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Stefan Hajnoczi March 13, 2011, 4:10 p.m. UTC | #1
On Sat, Mar 5, 2011 at 5:52 PM, Aneesh Kumar K.V
<aneesh.kumar@linux.vnet.ibm.com> wrote:
> @@ -1873,7 +1873,7 @@ static void v9fs_post_lcreate(V9fsState *s, V9fsLcreateState *vs, int err)
>         vs->fidp->fsmap.fid_type = P9_FID_NONE;
>         err = -errno;
>         if (vs->fidp->fsmap.fs.fd > 0) {

For completeness: vs->fdip->fsmap.fs.fd >= 0

Stefan
Aneesh Kumar K.V March 13, 2011, 6:58 p.m. UTC | #2
On Sun, 13 Mar 2011 16:10:20 +0000, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Sat, Mar 5, 2011 at 5:52 PM, Aneesh Kumar K.V
> <aneesh.kumar@linux.vnet.ibm.com> wrote:
> > @@ -1873,7 +1873,7 @@ static void v9fs_post_lcreate(V9fsState *s, V9fsLcreateState *vs, int err)
> >         vs->fidp->fsmap.fid_type = P9_FID_NONE;
> >         err = -errno;
> >         if (vs->fidp->fsmap.fs.fd > 0) {
> 
> For completeness: vs->fdip->fsmap.fs.fd >= 0
> 

Will update

-aneesh
diff mbox

Patch

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 811ac38..c4b0198 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -1873,7 +1873,7 @@  static void v9fs_post_lcreate(V9fsState *s, V9fsLcreateState *vs, int err)
         vs->fidp->fsmap.fid_type = P9_FID_NONE;
         err = -errno;
         if (vs->fidp->fsmap.fs.fd > 0) {
-            close(vs->fidp->fsmap.fs.fd);
+            v9fs_do_close(s, vs->fidp->fsmap.fs.fd);
         }
     }
 
@@ -2533,7 +2533,7 @@  static void v9fs_create_post_fstat(V9fsState *s, V9fsCreateState *vs, int err)
 {
     if (err) {
         vs->fidp->fsmap.fid_type = P9_FID_NONE;
-        close(vs->fidp->fsmap.fs.fd);
+        v9fs_do_close(s, vs->fidp->fsmap.fs.fd);
         err = -errno;
     }
     v9fs_post_create(s, vs, err);