From owner-freebsd-arch Sat Oct 5 3: 2: 9 2002 Delivered-To: freebsd-arch@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 6EEF437B401; Sat, 5 Oct 2002 03:02:08 -0700 (PDT) Date: Sat, 5 Oct 2002 03:02:08 -0700 From: Juli Mallett To: Don Lewis Cc: arch@FreeBSD.ORG Subject: Re: [jmallett@FreeBSD.org: [PATCH] Reliable signal queues, etc., [for review]] Message-ID: <20021005030208.A22398@FreeBSD.org> References: <20021005011257.A16980@FreeBSD.org> <200210050929.g959T1vU023691@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200210050929.g959T1vU023691@gw.catspoiler.org>; from dl-freebsd@catspoiler.org on Sat, Oct 05, 2002 at 02:29:01AM -0700 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: Don Lewis [ 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 | 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