aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-09-20 21:58:36 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-09-20 21:58:36 +0200
commitaea5c83461dac53b8619b7bf2ef1fb348ecb4ef1 (patch)
treee75cd37d8489e437f995df9a2a57e87826c95fe1
parent2c46d1148650edf5d02051c3794227d52618db0c (diff)
downloadglibc-aea5c83461dac53b8619b7bf2ef1fb348ecb4ef1.tar
glibc-aea5c83461dac53b8619b7bf2ef1fb348ecb4ef1.tar.gz
glibc-aea5c83461dac53b8619b7bf2ef1fb348ecb4ef1.tar.bz2
glibc-aea5c83461dac53b8619b7bf2ef1fb348ecb4ef1.zip
Fix exc2signal.c template
As a follow-up to 0e3426bbcf2ff61d06d580fc9362fde79953a281 * hurd/exc2signal.c: #include <hurd/signal.h> (_hurd_exception2signal): Replace 'exception', 'code', 'subcode', 'sigcode', 'error' parameters with 'detail' parameter. Fix code accordingly.
-rw-r--r--ChangeLog7
-rw-r--r--hurd/exc2signal.c24
2 files changed, 19 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 338777b9c6..7f960669a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-09-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * hurd/exc2signal.c: #include <hurd/signal.h>
+ (_hurd_exception2signal): Replace 'exception', 'code', 'subcode',
+ 'sigcode', 'error' parameters with 'detail' parameter. Fix code
+ accordingly.
+
2016-09-20 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
* math/Makefile (libm-calls): Remove s_nanF.
diff --git a/hurd/exc2signal.c b/hurd/exc2signal.c
index 3a2ec08124..2527d83bf1 100644
--- a/hurd/exc2signal.c
+++ b/hurd/exc2signal.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <hurd.h>
+#include <hurd/signal.h>
/* This file must be modified with machine-dependent details. */
#error "need to write sysdeps/mach/hurd/MACHINE/exc2signal.c"
@@ -25,46 +26,45 @@
into a signal number and signal subcode. */
void
-_hurd_exception2signal (int exception, int code, int subcode,
- int *signo, int *sigcode, int *error)
+_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
{
- *error = 0;
+ detail->error = 0;
- switch (exception)
+ switch (detail->exc)
{
default:
*signo = SIGIOT;
- *sigcode = exception;
+ detail->code = detail->exc;
break;
case EXC_BAD_ACCESS:
- if (code == KERN_PROTECTION_FAILURE)
+ if (detail->exc_code == KERN_PROTECTION_FAILURE)
*signo = SIGSEGV;
else
*signo = SIGBUS;
- *sigcode = subcode;
- *error = code;
+ detail->code = detail->exc_subcode;
+ detail->error = detail->exc_code;
break;
case EXC_BAD_INSTRUCTION:
*signo = SIGILL;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_ARITHMETIC:
*signo = SIGFPE;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_EMULATION:
case EXC_SOFTWARE:
*signo = SIGEMT;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_BREAKPOINT:
*signo = SIGTRAP;
- *sigcode = 0;
+ detail->code = 0;
break;
}
}