[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/11] proc: store the privileged host port in _hurd_host_pri
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 10/11] proc: store the privileged host port in _hurd_host_priv |
Date: |
Wed, 27 Nov 2013 22:50:24 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Wed 27 Nov 2013 13:31:17 +0100, a écrit :
> Store the privileged host port in _hurd_host_priv like it is done in
> the root filesystem. This fixes the thread priority adjustment in the
> proc server. Prior to this fix, a warning message "unable to adjust
> libports thread priority" sometimes appeared early in the boot
> process.
Ack.
>
> * proc/host.c (S_proc_getprivports): Adapt accordingly.
> (S_proc_register_version): Likewise.
> * proc/mgt.c (add_tasks): Likewise.
> * proc/msg.c (tickle_init): Likewise.
> * proc/main.c (main): Store the privileged host port in _hurd_host_priv.
> * proc/proc.h: Remove unused variable master_host_port.
>
> fixup_store_priv_port
> ---
> proc/host.c | 4 ++--
> proc/main.c | 4 ++--
> proc/mgt.c | 2 +-
> proc/msg.c | 2 +-
> proc/proc.h | 1 -
> 5 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/proc/host.c b/proc/host.c
> index 488863b..b5c93b4 100644
> --- a/proc/host.c
> +++ b/proc/host.c
> @@ -70,7 +70,7 @@ S_proc_getprivports (struct proc *p,
> if (! check_uid (p, 0))
> return EPERM;
>
> - *hostpriv = master_host_port;
> + *hostpriv = _hurd_host_priv;
> *devpriv = master_device_port;
> return 0;
> }
> @@ -419,7 +419,7 @@ S_proc_register_version (pstruct_t server,
>
> /* No need to check SERVER here; we don't use it. */
>
> - if (credential != master_host_port)
> + if (credential != _hurd_host_priv)
> /* Must be privileged to register for uname. */
> return EPERM;
>
> diff --git a/proc/main.c b/proc/main.c
> index 6b18737..7be89ce 100644
> --- a/proc/main.c
> +++ b/proc/main.c
> @@ -92,7 +92,7 @@ main (int argc, char **argv, char **envp)
>
> startup_port = ports_get_send_right (startup_proc);
> err = startup_procinit (boot, startup_port, &startup_proc->p_task,
> - &authserver, &master_host_port, &master_device_port);
> + &authserver, &_hurd_host_priv, &master_device_port);
> assert_perror (err);
> mach_port_deallocate (mach_task_self (), startup_port);
>
> @@ -111,7 +111,7 @@ main (int argc, char **argv, char **envp)
> important. */
> err = thread_get_assignment (mach_thread_self (), &pset);
> assert_perror (err);
> - err = host_processor_set_priv (master_host_port, pset, &psetcntl);
> + err = host_processor_set_priv (_hurd_host_priv, pset, &psetcntl);
> assert_perror (err);
> thread_max_priority (mach_thread_self (), psetcntl, 0);
> assert_perror (err);
> diff --git a/proc/mgt.c b/proc/mgt.c
> index 11b2f39..602ba84 100644
> --- a/proc/mgt.c
> +++ b/proc/mgt.c
> @@ -828,7 +828,7 @@ add_tasks (task_t task)
>
> if (!foundp)
> {
> - host_processor_set_priv (master_host_port, psets[i], &psetpriv);
> + host_processor_set_priv (_hurd_host_priv, psets[i], &psetpriv);
> processor_set_tasks (psetpriv, &tasks, &ntasks);
> for (j = 0; j < ntasks; j++)
> {
> diff --git a/proc/msg.c b/proc/msg.c
> index a6eca21..796cae3 100644
> --- a/proc/msg.c
> +++ b/proc/msg.c
> @@ -40,7 +40,7 @@ static void *
> tickle_init (void *initport)
> {
> startup_essential_task ((mach_port_t) initport, mach_task_self (),
> - MACH_PORT_NULL, "proc", master_host_port);
> + MACH_PORT_NULL, "proc", _hurd_host_priv);
> return NULL;
> }
>
> diff --git a/proc/proc.h b/proc/proc.h
> index d528a7d..783aba9 100644
> --- a/proc/proc.h
> +++ b/proc/proc.h
> @@ -141,7 +141,6 @@ struct port_class *proc_class;
> struct port_class *generic_port_class;
> struct port_class *exc_class;
>
> -mach_port_t master_host_port;
> mach_port_t master_device_port;
>
> mach_port_t generic_port; /* messages not related to a specific proc */
> --
> 1.7.10.4
>
--
Samuel
AUTHOR
FvwmM4 is the result of a random bit mutation on a hard
disk, presumably a result of a cosmic-ray or some such
thing.
(extrait de la page de man de FvwmM4)
- Re: [PATCH 04/11] libports: improve error handling in ports_reallocate_port, (continued)
- [PATCH 02/11] init: fix port leak, Justus Winter, 2013/11/27
- [PATCH 05/11] libports: improve error handling in ports_reallocate_from_external, Justus Winter, 2013/11/27
- [PATCH 06/11] libports: improve error handling in ports_transfer_right, Justus Winter, 2013/11/27
- [PATCH 07/11] libdiskfs: improve error reporting in diskfs_start_disk_pager, Justus Winter, 2013/11/27
- [PATCH 10/11] proc: store the privileged host port in _hurd_host_priv, Justus Winter, 2013/11/27
- Re: [PATCH 10/11] proc: store the privileged host port in _hurd_host_priv,
Samuel Thibault <=
- [PATCH 09/11] libports: improve error reporting in adjust_priority, Justus Winter, 2013/11/27
- [PATCH 08/11] libfshelp: improve error handling in fshelp_start_translator_long, Justus Winter, 2013/11/27
- [PATCH 11/11] proc: store the device master port in _hurd_device_master, Justus Winter, 2013/11/27
- Re: [PATCH 01/11] libshouldbeinlibc: fix minor port leak in maptime_map, Samuel Thibault, 2013/11/27