From 83ef7119f6d880f0eaaf8af2d34199c80a501024 Mon Sep 17 00:00:00 2001 From: Cristiano Giuffrida Date: Wed, 28 Apr 2010 20:41:23 +0000 Subject: [PATCH] Don't panic when out of priv structures. --- servers/rs/manager.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/servers/rs/manager.c b/servers/rs/manager.c index e78fb2630..6114e91d9 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -453,10 +453,17 @@ struct rproc *rp; init_privs(rp, &rp->r_priv); } - /* Set and synch the privilege structure for the new service. */ + /* Set and synch the privilege structure for the new service. + * In case the following fails, we can't kill the process as no signal + * manager has been assigned yet. The solution is to directly call + * terminate_service() without sending any signal to the process. + */ if ((s = sys_privctl(child_proc_nr_e, SYS_PRIV_SET_SYS, &rp->r_priv)) != OK || (s = sys_getpriv(&rp->r_priv, child_proc_nr_e)) != OK) { - panic("unable to set privilege structure: %d", s); + printf("unable to set privilege structure: %d\n", s); + rp->r_flags |= RS_EXITING; + terminate_service(rp); + return ENOMEM; } /* Copy the executable image into the child process. If this call -- 2.44.0