git: 55976ce11a10 - main - Move sv_onexit() sysentvec hook slightly later

Konstantin Belousov kib at FreeBSD.org
Wed Jul 7 11:12:30 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=55976ce11a10765dee6c71b7ed6eac016bd560ef

commit 55976ce11a10765dee6c71b7ed6eac016bd560ef
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-07-01 18:06:42 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-07-07 11:12:07 +0000

    Move sv_onexit() sysentvec hook slightly later
    
    after itimers are stopped.  This makes it more usable for e.g. native FreeBSD
    ABI sysentvecs.
    
    Reviewed by:    dchagin, markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      2 weeks
    Differential revision:  https://reviews.freebsd.org/D30987
---
 sys/kern/kern_exit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index fcd8b39a8ee2..515c2d4e6397 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -340,9 +340,6 @@ exit1(struct thread *td, int rval, int signo)
 
 	itimers_exit(p);
 
-	if (p->p_sysent->sv_onexit != NULL)
-		p->p_sysent->sv_onexit(p);
-
 	/*
 	 * Check if any loadable modules need anything done at process exit.
 	 * E.g. SYSV IPC stuff.
@@ -374,6 +371,8 @@ exit1(struct thread *td, int rval, int signo)
 	PROC_UNLOCK(p);
 
 	umtx_thread_exit(td);
+	if (p->p_sysent->sv_onexit != NULL)
+		p->p_sysent->sv_onexit(p);
 	seltdfini(td);
 
 	/*


More information about the dev-commits-src-all mailing list