bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] console-client: deallocate the port once finished with it


From: Sergey Bugaev
Subject: Re: [PATCH] console-client: deallocate the port once finished with it
Date: Wed, 13 Mar 2024 19:09:05 +0300

On Wed, Mar 13, 2024 at 1:56 PM Etienne Brateau
<etienne.brateau@gmail.com> wrote:
>  console-client/trans.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/console-client/trans.c b/console-client/trans.c
> index b7d56cb0..a3d6dd3c 100644
> --- a/console-client/trans.c
> +++ b/console-client/trans.c
> @@ -898,6 +898,7 @@ console_setup_node (char *path)
>    err = file_set_translator (node, 0, FS_TRANS_EXCL | FS_TRANS_SET, 0, 0, 0,
>                              right, MACH_MSG_TYPE_COPY_SEND);
>    mach_port_deallocate (mach_task_self (), right);
> +  ports_port_deref (newpi);

Makes sense to me.

While at it, you could also replace ports_get_send_right () +
MACH_MSG_TYPE_COPY_SEND + mach_port_deallocate () with ports_get_right
() + MACH_MSG_TYPE_MAKE_SEND.

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]