Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Small comment improvement.



details:   https://anonhg.NetBSD.org/src/rev/e32e3e2f5bb8
branches:  trunk
changeset: 764664:e32e3e2f5bb8
user:      rmind <rmind%NetBSD.org@localhost>
date:      Fri Apr 29 22:57:54 2011 +0000

description:
Small comment improvement.

diffstat:

 sys/kern/kern_core.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r a37a2b2e5ec5 -r e32e3e2f5bb8 sys/kern/kern_core.c
--- a/sys/kern/kern_core.c      Fri Apr 29 22:52:02 2011 +0000
+++ b/sys/kern/kern_core.c      Fri Apr 29 22:57:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_core.c,v 1.17 2010/11/19 06:44:42 dholland Exp $  */
+/*     $NetBSD: kern_core.c,v 1.18 2011/04/29 22:57:54 rmind Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.17 2010/11/19 06:44:42 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.18 2011/04/29 22:57:54 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/vnode.h>
@@ -164,17 +164,20 @@
                pattern = security_setidcore_path;
        }
 
-       /* It is (just) possible for p_limit and pl_corename to change */
+       /* Lock, as p_limit and pl_corename might change. */
        lim = p->p_limit;
        mutex_enter(&lim->pl_lock);
-       if (pattern == NULL)
+       if (pattern == NULL) {
                pattern = lim->pl_corename;
+       }
        error = coredump_buildname(p, name, pattern, MAXPATHLEN);
        mutex_exit(&lim->pl_lock);
+
        mutex_exit(p->p_lock);
        mutex_exit(proc_lock);
-       if (error)
+       if (error) {
                goto done;
+       }
 
        pb = pathbuf_create(name);
        if (pb == NULL) {



Home | Main Index | Thread Index | Old Index