Eliminate semexit_hook using at_exit(9) and rm_at_exit(9).
Reviewed by: alfred
This commit is contained in:
parent
881c9063c7
commit
477b78a0df
@ -209,11 +209,6 @@ exit1(td, rv)
|
||||
}
|
||||
PROC_UNLOCK(p->p_leader);
|
||||
|
||||
/*
|
||||
* XXX Shutdown SYSV semaphores
|
||||
*/
|
||||
semexit(p);
|
||||
|
||||
/* The next two chunks should probably be moved to vmspace_exit. */
|
||||
vm = p->p_vmspace;
|
||||
/*
|
||||
|
@ -41,21 +41,9 @@
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ucred.h>
|
||||
|
||||
void (*semexit_hook)(struct proc *) = NULL;
|
||||
void (*shmfork_hook)(struct proc *, struct proc *) = NULL;
|
||||
void (*shmexit_hook)(struct proc *) = NULL;
|
||||
|
||||
/* called from kern_exit.c */
|
||||
void
|
||||
semexit(p)
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
if (semexit_hook != NULL)
|
||||
semexit_hook(p);
|
||||
return;
|
||||
}
|
||||
|
||||
/* called from kern_fork.c */
|
||||
void
|
||||
shmfork(p1, p2)
|
||||
|
@ -202,7 +202,7 @@ seminit(void)
|
||||
suptr->un_proc = NULL;
|
||||
}
|
||||
semu_list = NULL;
|
||||
semexit_hook = &semexit_myhook;
|
||||
at_exit(semexit_myhook);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -215,7 +215,7 @@ semunload(void)
|
||||
free(sem, M_SEM);
|
||||
free(sema, M_SEM);
|
||||
free(semu, M_SEM);
|
||||
semexit_hook = NULL;
|
||||
rm_at_exit(semexit_myhook);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,6 @@ struct thread;
|
||||
struct proc;
|
||||
|
||||
int ipcperm __P((struct thread *, struct ipc_perm *, int));
|
||||
extern void (*semexit_hook)(struct proc *);
|
||||
extern void (*shmfork_hook)(struct proc *, struct proc *);
|
||||
extern void (*shmexit_hook)(struct proc *);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user