summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2020-03-13 09:25:21 +0000
committermpi <mpi@openbsd.org>2020-03-13 09:25:21 +0000
commitc74ff8cf4d71e98b8a7101b467101ad72cbe6604 (patch)
treebc695318b79eabeba66dbdf95987679d7a3d6c91
parentBlock autoaction after it kicks in, until 60 seconds after resume (diff)
downloadwireguard-openbsd-c74ff8cf4d71e98b8a7101b467101ad72cbe6604.tar.xz
wireguard-openbsd-c74ff8cf4d71e98b8a7101b467101ad72cbe6604.zip
Rename "sigacts" flag field to avoid conflict with the "process" one.
This shows that atomic_* operations should not be necessery to write to this field unlike with the process one. The advantage of using a somewhat-unique prefix for struct member is moot when multiple definitions use the same prefix :o) From Amit Kulkarni, ok claudio@
-rw-r--r--sys/kern/init_main.c4
-rw-r--r--sys/kern/kern_exit.c4
-rw-r--r--sys/kern/kern_sig.c20
-rw-r--r--sys/sys/signalvar.h4
4 files changed, 16 insertions, 16 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 2be1d41b8ab..20b2749cf88 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.296 2020/02/25 16:55:33 visa Exp $ */
+/* $OpenBSD: init_main.c,v 1.297 2020/03/13 09:25:21 mpi Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -639,7 +639,7 @@ start_init(void *arg)
check_console(p);
/* process 0 ignores SIGCHLD, but we can't */
- p->p_p->ps_sigacts->ps_flags = 0;
+ p->p_p->ps_sigacts->ps_sigflags = 0;
/*
* Need just enough stack to hold the faked-up "execve()" arguments.
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 826d7e0419f..73b90e24cff 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.185 2020/03/01 18:50:52 mpi Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.186 2020/03/13 09:25:21 mpi Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -215,7 +215,7 @@ exit1(struct proc *p, int xexit, int xsig, int flags)
* If parent has the SAS_NOCLDWAIT flag set, we're not
* going to become a zombie.
*/
- if (pr->ps_pptr->ps_sigacts->ps_flags & SAS_NOCLDWAIT)
+ if (pr->ps_pptr->ps_sigacts->ps_sigflags & SAS_NOCLDWAIT)
atomic_setbits_int(&pr->ps_flags, PS_NOZOMBIE);
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 47e4732dc31..07a519e680b 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.252 2020/03/11 15:45:03 claudio Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.253 2020/03/13 09:25:21 mpi Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -285,9 +285,9 @@ sys_sigaction(struct proc *p, void *v, register_t *retval)
if ((ps->ps_siginfo & bit) != 0)
sa->sa_flags |= SA_SIGINFO;
if (signum == SIGCHLD) {
- if ((ps->ps_flags & SAS_NOCLDSTOP) != 0)
+ if ((ps->ps_sigflags & SAS_NOCLDSTOP) != 0)
sa->sa_flags |= SA_NOCLDSTOP;
- if ((ps->ps_flags & SAS_NOCLDWAIT) != 0)
+ if ((ps->ps_sigflags & SAS_NOCLDWAIT) != 0)
sa->sa_flags |= SA_NOCLDWAIT;
}
if ((sa->sa_mask & bit) == 0)
@@ -336,9 +336,9 @@ setsigvec(struct proc *p, int signum, struct sigaction *sa)
ps->ps_catchmask[signum] = sa->sa_mask &~ sigcantmask;
if (signum == SIGCHLD) {
if (sa->sa_flags & SA_NOCLDSTOP)
- atomic_setbits_int(&ps->ps_flags, SAS_NOCLDSTOP);
+ atomic_setbits_int(&ps->ps_sigflags, SAS_NOCLDSTOP);
else
- atomic_clearbits_int(&ps->ps_flags, SAS_NOCLDSTOP);
+ atomic_clearbits_int(&ps->ps_sigflags, SAS_NOCLDSTOP);
/*
* If the SA_NOCLDWAIT flag is set or the handler
* is SIG_IGN we reparent the dying child to PID 1
@@ -350,9 +350,9 @@ setsigvec(struct proc *p, int signum, struct sigaction *sa)
if (initprocess->ps_sigacts != ps &&
((sa->sa_flags & SA_NOCLDWAIT) ||
sa->sa_handler == SIG_IGN))
- atomic_setbits_int(&ps->ps_flags, SAS_NOCLDWAIT);
+ atomic_setbits_int(&ps->ps_sigflags, SAS_NOCLDWAIT);
else
- atomic_clearbits_int(&ps->ps_flags, SAS_NOCLDWAIT);
+ atomic_clearbits_int(&ps->ps_sigflags, SAS_NOCLDWAIT);
}
if ((sa->sa_flags & SA_RESETHAND) != 0)
ps->ps_sigreset |= bit;
@@ -406,7 +406,7 @@ siginit(struct process *pr)
for (i = 0; i < NSIG; i++)
if (sigprop[i] & SA_IGNORE && i != SIGCONT)
ps->ps_sigignore |= sigmask(i);
- ps->ps_flags = SAS_NOCLDWAIT | SAS_NOCLDSTOP;
+ ps->ps_sigflags = SAS_NOCLDWAIT | SAS_NOCLDSTOP;
}
/*
@@ -442,7 +442,7 @@ execsigs(struct proc *p)
* Clear set of signals caught on the signal stack.
*/
sigstkinit(&p->p_sigstk);
- atomic_clearbits_int(&ps->ps_flags, SAS_NOCLDWAIT);
+ atomic_clearbits_int(&ps->ps_sigflags, SAS_NOCLDWAIT);
if (ps->ps_sigact[SIGCHLD] == SIG_IGN)
ps->ps_sigact[SIGCHLD] = SIG_DFL;
}
@@ -1360,7 +1360,7 @@ proc_stop_sweep(void *v)
continue;
atomic_clearbits_int(&pr->ps_flags, PS_STOPPED);
- if ((pr->ps_pptr->ps_sigacts->ps_flags & SAS_NOCLDSTOP) == 0)
+ if ((pr->ps_pptr->ps_sigacts->ps_sigflags & SAS_NOCLDSTOP) == 0)
prsignal(pr->ps_pptr, SIGCHLD);
wakeup(pr->ps_pptr);
}
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index 6ac19bc463b..7ee361f2086 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signalvar.h,v 1.39 2020/03/11 15:45:04 claudio Exp $ */
+/* $OpenBSD: signalvar.h,v 1.40 2020/03/13 09:25:21 mpi Exp $ */
/* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */
/*
@@ -53,7 +53,7 @@ struct sigacts {
sigset_t ps_siginfo; /* signals that provide siginfo */
sigset_t ps_sigignore; /* signals being ignored */
sigset_t ps_sigcatch; /* signals being caught by user */
- int ps_flags; /* signal flags, below */
+ int ps_sigflags; /* signal flags, below */
};
/* signal flags */