Justus Winter, le Sun 13 Apr 2014 13:43:10 +0200, a écrit :
> mach_device_deallocate just called ports_port_deref. However, the
> reference counting is done by the translation functions, explicitly
> reducing the reference count is just wrong.
Ack.
> * libmachdev/ds_routines.c (mach_device_deallocate): Remove now unused
> function.
> (ds_device_close): Drop spurious call to mach_device_deallocate.
> ---
> libmachdev/ds_routines.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
> index 44f1139..2f9388a 100644
> --- a/libmachdev/ds_routines.c
> +++ b/libmachdev/ds_routines.c
> @@ -82,12 +82,6 @@ static int num_emul;
>
> boolean_t is_master_device (mach_port_t port);
>
> -static inline void
> -mach_device_deallocate (void *device)
> -{
> - ports_port_deref (device);
> -}
> -
> /*
> * What follows is the interface for the native Mach devices.
> */
> @@ -180,7 +174,6 @@ ds_device_close (struct mach_device *device)
> ret = (device->dev.emul_ops->close
> ? (*device->dev.emul_ops->close) (device->dev.emul_data)
> : D_SUCCESS);
> - mach_device_deallocate (device);
> return ret;
> }
>
> --
> 1.9.1
>
--
Samuel
"...very few phenomena can pull someone out of Deep Hack Mode, with two
noted exceptions: being struck by lightning, or worse, your *computer*
being struck by lightning."
(By Matt Welsh)