Date: Mon, 10 Aug 2009 17:59:07 GMT From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 167181 for review Message-ID: <200908101759.n7AHx7HG068969@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167181 Change 167181 by trasz@trasz_anger on 2009/08/10 17:59:04 Make 'sig*' actions work. Affected files ... .. //depot/projects/soc2009/trasz_limits/TODO#10 edit .. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#52 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/TODO#10 (text+ko) ==== @@ -17,6 +17,10 @@ - Some things need to be accounted for per-euid, and some per-egid. Geez. + - In maxproc limit, make sure the 'p' argument is a child process. Otherwise, + if one adds rule with 'sig*' action, the signal will be sent to the parent + instead of the child. + - Add sorting to hrl(8). - Use expand_number(3) in hrl(8). ==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#52 (text+ko) ==== @@ -233,10 +233,19 @@ static void hrl_deferred_psignal(struct proc *p, int signum) { + int need_lock; + + /* + * XXX: This is ugly. Either turn it into a real taskqueue, + * or think about the locking and don't lock proc here. + */ + need_lock = !PROC_LOCKED(p); - PROC_LOCK(p); + if (need_lock) + PROC_LOCK(p); psignal(p, signum); - PROC_UNLOCK(p); + if (need_lock) + PROC_UNLOCK(p); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908101759.n7AHx7HG068969>