Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Ensure that all callers of pfind() can deal with pfind(0...



details:   https://anonhg.NetBSD.org/src/rev/36c45ae8f6f3
branches:  trunk
changeset: 486774:36c45ae8f6f3
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Sun May 28 18:17:07 2000 +0000

description:
Ensure that all callers of pfind() can deal with pfind(0) returning
a real procp* rather than NULL.

diffstat:

 sys/kern/subr_log.c |  4 ++--
 sys/net/bpf.c       |  4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e58b7acf98b9 -r 36c45ae8f6f3 sys/kern/subr_log.c
--- a/sys/kern/subr_log.c       Sun May 28 17:31:27 2000 +0000
+++ b/sys/kern/subr_log.c       Sun May 28 18:17:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_log.c,v 1.18 2000/03/30 09:27:13 augustss Exp $   */
+/*     $NetBSD: subr_log.c,v 1.19 2000/05/28 18:17:07 jhawk Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -220,7 +220,7 @@
        if (logsoftc.sc_state & LOG_ASYNC) {
                if (logsoftc.sc_pgid < 0)
                        gsignal(-logsoftc.sc_pgid, SIGIO); 
-               else if ((p = pfind(logsoftc.sc_pgid)) != NULL)
+               else if (p && (p = pfind(logsoftc.sc_pgid)) != NULL)
                        psignal(p, SIGIO);
        }
        if (logsoftc.sc_state & LOG_RDWAIT) {
diff -r e58b7acf98b9 -r 36c45ae8f6f3 sys/net/bpf.c
--- a/sys/net/bpf.c     Sun May 28 17:31:27 2000 +0000
+++ b/sys/net/bpf.c     Sun May 28 18:17:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.56 2000/05/28 02:49:35 matt Exp $    */
+/*     $NetBSD: bpf.c,v 1.57 2000/05/28 18:17:09 jhawk Exp $   */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -499,7 +499,7 @@
        if (d->bd_async) {
                if (d->bd_pgid > 0)
                        gsignal (d->bd_pgid, SIGIO);
-               else if ((p = pfind (-d->bd_pgid)) != NULL)
+               else if (d->bd_pgid && (p = pfind (-d->bd_pgid)) != NULL)
                        psignal (p, SIGIO);
        }
 



Home | Main Index | Thread Index | Old Index