[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/6] libmachdev: fix device_open
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 1/6] libmachdev: fix device_open |
Date: |
Mon, 14 Apr 2014 01:39:12 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Sun 13 Apr 2014 13:43:09 +0200, a écrit :
> device_open used to explicitly call ds_device_open_reply instead of
> just letting the mig-generated wrapper around ds_device_open generate
> the return message. There is really no need for that.
Ack.
> * libmachdev/net.c: Do not include device_reply_U.h.
> (device_open): Do not call ds_device_open_reply.
> Set *devicePoly to MACH_MSG_TYPE_MAKE_SEND.
> ---
> libmachdev/ds_routines.c | 1 -
> libmachdev/net.c | 13 ++++++-------
> 2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
> index 0e431a3..44f1139 100644
> --- a/libmachdev/ds_routines.c
> +++ b/libmachdev/ds_routines.c
> @@ -64,7 +64,6 @@
>
> #include "vm_param.h"
> #include "device_S.h"
> -#include "device_reply_U.h"
> #include "io_req.h"
> #include "dev_hdr.h"
> #include "util.h"
> diff --git a/libmachdev/net.c b/libmachdev/net.c
> index 501c9bb..300d946 100644
> --- a/libmachdev/net.c
> +++ b/libmachdev/net.c
> @@ -368,15 +368,14 @@ device_open (mach_port_t reply_port,
> mach_msg_type_name_t reply_port_type,
> dev->set_multicast_list (dev);
> #endif
> }
> - if (MACH_PORT_VALID (reply_port))
> - ds_device_open_reply (reply_port, reply_port_type,
> - err, dev_to_port (nd));
> - return MIG_NO_REPLY;
> }
>
> - *devp = ports_get_right (nd);
> - *devicePoly = MACH_MSG_TYPE_COPY_SEND;
> - return D_SUCCESS;
> + if (nd)
> + {
> + *devp = ports_get_right (nd);
> + *devicePoly = MACH_MSG_TYPE_MAKE_SEND;
> + }
> + return err;
> }
>
> static io_return_t
> --
> 1.9.1
>
--
Samuel
"c'est pas nous qui sommes à la rue, c'est la rue qui est à nous"
- more dde fixes, Justus Winter, 2014/04/13
- [PATCH 1/6] libmachdev: fix device_open, Justus Winter, 2014/04/13
- Re: [PATCH 1/6] libmachdev: fix device_open,
Samuel Thibault <=
- [PATCH 2/6] libmachdev: remove mach_device_deallocate, Justus Winter, 2014/04/13
- [PATCH 3/6] libmachdev: make the two port buckets clearly distinct, Justus Winter, 2014/04/13
- [PATCH 4/6] libmachdev: drop unused declarations, Justus Winter, 2014/04/13
- [PATCH 6/6] libmachdev: add, fix and use declaration for create_device_port, Justus Winter, 2014/04/13
- [PATCH 5/6] libmachdev: add missing includes, Justus Winter, 2014/04/13