summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-05-01 15:30:31 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-05-01 15:30:31 +0000
commit4867f442be3930ae66b41d0be9f12cac218be465 (patch)
treecd9eb7114c963fb026b8627c4db378f50c3ba05f /sys
parent424bcc2b3d19dd572f3ddb7504193ed8b617dee4 (diff)
Sync hpux_sendsig() behaviour with native sendsig(): let malloc fail and
sigexit the process in this case.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hp300/hp300/hpux_machdep.c10
-rw-r--r--sys/arch/mvme68k/mvme68k/hpux_machdep.c10
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/arch/hp300/hp300/hpux_machdep.c b/sys/arch/hp300/hp300/hpux_machdep.c
index e180c0a2789..74eec250d6c 100644
--- a/sys/arch/hp300/hp300/hpux_machdep.c
+++ b/sys/arch/hp300/hp300/hpux_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpux_machdep.c,v 1.21 2007/11/02 19:18:54 martin Exp $ */
+/* $OpenBSD: hpux_machdep.c,v 1.22 2008/05/01 15:30:29 miod Exp $ */
/* $NetBSD: hpux_machdep.c,v 1.19 1998/02/16 20:58:30 thorpej Exp $ */
/*
@@ -419,7 +419,13 @@ hpux_sendsig(catcher, sig, mask, code, type, val)
p->p_pid, sig, &oonstack, fp, &fp->hsf_sc, ft);
#endif
- kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP, M_WAITOK);
+ kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP,
+ M_WAITOK | M_CANFAIL);
+ if (kfp == NULL) {
+ /* Better halt the process in its track than panicing */
+ sigexit(p, SIGILL);
+ /* NOTREACHED */
+ }
/*
* Build the argument list for the signal handler.
diff --git a/sys/arch/mvme68k/mvme68k/hpux_machdep.c b/sys/arch/mvme68k/mvme68k/hpux_machdep.c
index b454ace3c01..2c10d677863 100644
--- a/sys/arch/mvme68k/mvme68k/hpux_machdep.c
+++ b/sys/arch/mvme68k/mvme68k/hpux_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpux_machdep.c,v 1.15 2007/11/02 19:18:54 martin Exp $ */
+/* $OpenBSD: hpux_machdep.c,v 1.16 2008/05/01 15:30:30 miod Exp $ */
/* $NetBSD: hpux_machdep.c,v 1.9 1997/03/16 10:00:45 thorpej Exp $ */
/*
@@ -458,7 +458,13 @@ hpux_sendsig(catcher, sig, mask, code, type, val)
p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft);
#endif
- kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP, M_WAITOK);
+ kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP,
+ M_WAITOK | M_CANFAIL);
+ if (kfp == NULL) {
+ /* Better halt the process in its track than panicing */
+ sigexit(p, SIGILL);
+ /* NOTREACHED */
+ }
/*
* Build the argument list for the signal handler.