Date: Sat, 5 Oct 2002 03:02:08 -0700 From: Juli Mallett <jmallett@FreeBSD.org> To: Don Lewis <dl-freebsd@catspoiler.org> Cc: arch@FreeBSD.ORG Subject: Re: [jmallett@FreeBSD.org: [PATCH] Reliable signal queues, etc., [for review]] Message-ID: <20021005030208.A22398@FreeBSD.org> In-Reply-To: <200210050929.g959T1vU023691@gw.catspoiler.org>; from dl-freebsd@catspoiler.org on Sat, Oct 05, 2002 at 02:29:01AM -0700 References: <20021005011257.A16980@FreeBSD.org> <200210050929.g959T1vU023691@gw.catspoiler.org>
index | next in thread | previous in thread | raw e-mail
* De: Don Lewis <dl-freebsd@catspoiler.org> [ Data: 2002-10-05 ]
[ Subjecte: Re: [jmallett@FreeBSD.org: [PATCH] Reliable signal queues, etc., [for review]] ]
> The following code never sets error to anything other than zero. It
> also looks like it is missing a return statement for the malloc() failed
> case.
Oops. That's because of the hefty use of the 'd' key in vi when removing
local additions. Thanks.
> +int
> +ksiginfo_alloc(struct ksiginfo **ksip, struct proc *p, int signo)
> +{
> + int error;
> + struct ksiginfo *ksi;
> +
> + error = 0;
> +
> + PROC_LOCK_ASSERT(p, MA_NOTOWNED);
> + ksi = malloc(sizeof *ksi, M_KSIGINFO, M_ZERO | M_NOWAIT);
> + if (ksi == NULL) {
> + PROC_LOCK(p);
> + p->p_suicide = 1;
> + PROC_UNLOCK(p);
> + }
> + ksi->ksi_signo = signo;
> + if (curproc != NULL) {
> + ksi->ksi_pid = curproc->p_pid;
> + ksi->ksi_ruid = curproc->p_ucred->cr_uid;
> + }
> + *ksip = ksi;
> + return (error);
> +}
>
>
>
>
>
>
--
Juli Mallett <jmallett@FreeBSD.org> | FreeBSD: The Power To Serve
Will break world for fulltime employment. | finger jmallett@FreeBSD.org
http://people.FreeBSD.org/~jmallett/ | Support my FreeBSD hacking!
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021005030208.A22398>
