Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys no need to pass the coredump flag to exit1() since it is...
details: https://anonhg.NetBSD.org/src/rev/a3a482c18c85
branches: trunk
changeset: 344569:a3a482c18c85
user: christos <christos%NetBSD.org@localhost>
date: Mon Apr 04 23:07:06 2016 +0000
description:
no need to pass the coredump flag to exit1() since it is set and known
in one place.
diffstat:
sys/compat/svr4_32/svr4_32_signal.c | 6 +++---
sys/kern/kern_exec.c | 8 ++++----
sys/kern/kern_exit.c | 10 ++++------
sys/kern/kern_lwp.c | 6 +++---
sys/kern/kern_sig.c | 13 +++++++------
sys/sys/proc.h | 4 ++--
sys/sys/sysctl.h | 3 ++-
7 files changed, 25 insertions(+), 25 deletions(-)
diffs (223 lines):
diff -r 2f0ef4686154 -r a3a482c18c85 sys/compat/svr4_32/svr4_32_signal.c
--- a/sys/compat/svr4_32/svr4_32_signal.c Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/compat/svr4_32/svr4_32_signal.c Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svr4_32_signal.c,v 1.27 2016/04/04 21:21:49 christos Exp $ */
+/* $NetBSD: svr4_32_signal.c,v 1.28 2016/04/04 23:07:06 christos Exp $ */
/*-
* Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.27 2016/04/04 21:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.28 2016/04/04 23:07:06 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_svr4.h"
@@ -630,7 +630,7 @@
case SVR4_SETCONTEXT:
DPRINTF(("setcontext(%p)\n", SCARG(uap, uc)));
if (!SCARG_P32(uap, uc))
- exit1(l, 0, 0, 0);
+ exit1(l, 0, 0);
else if ((error = copyin(SCARG_P32(uap, uc),
&uc, sizeof(uc))) != 0)
return error;
diff -r 2f0ef4686154 -r a3a482c18c85 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/kern/kern_exec.c Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.425 2016/04/04 20:47:57 christos Exp $ */
+/* $NetBSD: kern_exec.c,v 1.426 2016/04/04 23:07:06 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.425 2016/04/04 20:47:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.426 2016/04/04 23:07:06 christos Exp $");
#include "opt_exec.h"
#include "opt_execfmt.h"
@@ -1350,7 +1350,7 @@
/* Acquire the sched-state mutex (exit1() will release it). */
if (!is_spawn) {
mutex_enter(p->p_lock);
- exit1(l, error, SIGABRT, 0);
+ exit1(l, error, SIGABRT);
}
return error;
@@ -2229,7 +2229,7 @@
* A NetBSD specific workaround is POSIX_SPAWN_RETURNERROR as
* flag bit in the attrp argument to posix_spawn(2), see above.
*/
- exit1(l, 127, 0, 0);
+ exit1(l, 127, 0);
}
void
diff -r 2f0ef4686154 -r a3a482c18c85 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/kern/kern_exit.c Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exit.c,v 1.252 2016/04/04 20:47:57 christos Exp $ */
+/* $NetBSD: kern_exit.c,v 1.253 2016/04/04 23:07:06 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.252 2016/04/04 20:47:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.253 2016/04/04 23:07:06 christos Exp $");
#include "opt_ktrace.h"
#include "opt_dtrace.h"
@@ -183,7 +183,7 @@
}
/* exit1() will release the mutex. */
- exit1(l, SCARG(uap, rval), 0, 0);
+ exit1(l, SCARG(uap, rval), 0);
/* NOTREACHED */
return (0);
}
@@ -196,7 +196,7 @@
* Must be called with p->p_lock held. Does not return.
*/
void
-exit1(struct lwp *l, int exitcode, int signo, int coredump)
+exit1(struct lwp *l, int exitcode, int signo)
{
struct proc *p, *child, *next_child, *old_parent, *new_parent;
struct pgrp *pgrp;
@@ -307,8 +307,6 @@
p->p_xexit = exitcode;
p->p_xsig = signo;
- if (coredump)
- p->p_sflag |= PS_COREDUMP;
/*
* If emulation has process exit hook, call it now.
diff -r 2f0ef4686154 -r a3a482c18c85 sys/kern/kern_lwp.c
--- a/sys/kern/kern_lwp.c Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/kern/kern_lwp.c Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_lwp.c,v 1.183 2016/04/04 20:47:57 christos Exp $ */
+/* $NetBSD: kern_lwp.c,v 1.184 2016/04/04 23:07:06 christos Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.183 2016/04/04 20:47:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.184 2016/04/04 23:07:06 christos Exp $");
#include "opt_ddb.h"
#include "opt_lockdebug.h"
@@ -1043,7 +1043,7 @@
KASSERT(current == true);
KASSERT(p != &proc0);
/* XXXSMP kernel_lock not held */
- exit1(l, 0, 0, 0);
+ exit1(l, 0, 0);
/* NOTREACHED */
}
p->p_nzlwps++;
diff -r 2f0ef4686154 -r a3a482c18c85 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/kern/kern_sig.c Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sig.c,v 1.322 2016/04/04 20:47:57 christos Exp $ */
+/* $NetBSD: kern_sig.c,v 1.323 2016/04/04 23:07:06 christos Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.322 2016/04/04 20:47:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.323 2016/04/04 23:07:06 christos Exp $");
#include "opt_ptrace.h"
#include "opt_dtrace.h"
@@ -1946,7 +1946,7 @@
void
sigexit(struct lwp *l, int signo)
{
- int exitsig, error, docore, coreflag = 0;
+ int exitsig, error, docore;
struct proc *p;
struct lwp *t;
@@ -2017,8 +2017,7 @@
if (docore) {
mutex_exit(p->p_lock);
- if ((error = (*coredump_vec)(l, NULL)) == 0)
- coreflag = 1;
+ error = (*coredump_vec)(l, NULL);
if (kern_logsigexit) {
int uid = l->l_cred ?
@@ -2037,12 +2036,14 @@
#endif /* PAX_SEGVGUARD */
/* Acquire the sched state mutex. exit1() will release it. */
mutex_enter(p->p_lock);
+ if (error == 0)
+ p->p_sflag |= PS_COREDUMP;
}
/* No longer dumping core. */
p->p_sflag &= ~PS_WCORE;
- exit1(l, 0, exitsig, coreflag);
+ exit1(l, 0, exitsig);
/* NOTREACHED */
}
diff -r 2f0ef4686154 -r a3a482c18c85 sys/sys/proc.h
--- a/sys/sys/proc.h Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/sys/proc.h Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: proc.h,v 1.328 2016/04/04 20:47:57 christos Exp $ */
+/* $NetBSD: proc.h,v 1.329 2016/04/04 23:07:06 christos Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -491,7 +491,7 @@
int mtsleep(wchan_t, pri_t, const char *, int, kmutex_t *);
void wakeup(wchan_t);
int kpause(const char *, bool, int, kmutex_t *);
-void exit1(struct lwp *, int, int, int) __dead;
+void exit1(struct lwp *, int, int) __dead;
int kill1(struct lwp *l, pid_t pid, ksiginfo_t *ksi, register_t *retval);
int do_sys_wait(int *, int *, int, struct rusage *);
struct proc *proc_alloc(void);
diff -r 2f0ef4686154 -r a3a482c18c85 sys/sys/sysctl.h
--- a/sys/sys/sysctl.h Mon Apr 04 22:14:38 2016 +0000
+++ b/sys/sys/sysctl.h Mon Apr 04 23:07:06 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysctl.h,v 1.219 2016/01/18 23:27:49 pooka Exp $ */
+/* $NetBSD: sysctl.h,v 1.220 2016/04/04 23:07:06 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -38,6 +38,7 @@
#define _SYS_SYSCTL_H_
#include <sys/param.h> /* precautionary upon removal from ucred.h */
+#include <sys/wait.h> /* WCOREFLAG */
#include <sys/proc.h> /* Needed for things like P_ZOMBIE() and LW_SINTR */
#include <uvm/uvm_param.h>
Home |
Main Index |
Thread Index |
Old Index