Commit ef99b52f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 68aa2401
......@@ -109,8 +109,12 @@ cdef void _read_mustfault(const unsigned char *p) nogil except +topyexc:
act.sa_handler = mustfaultSighand
act.sa_flags = 0
sigemptyset(&act.sa_mask) # XXX err
sigaction(SIGSEGV, &act, &saveact) # XXX err
err = sigemptyset(&act.sa_mask)
if err != 0:
panic("sigemptyset: failed")
err = sigaction(SIGSEGV, &act, &saveact)
if err != 0:
panic("sigaction SIGSEGV -> mustfaultSighand: failed")
faultExpected = True
faultedOk = False
......@@ -124,7 +128,9 @@ cdef void _read_mustfault(const unsigned char *p) nogil except +topyexc:
panic("faulted, but !faultedOk")
faultExpected = False
sigaction(SIGSEGV, &saveact, NULL) # XXX err
err = sigaction(SIGSEGV, &saveact, NULL)
if err != 0:
panic("sigaction SIGSEGV <- restore: failed")
def read_mustfault(const unsigned char[::1] mem not None):
assert len(mem) == 1, "read_mustfault: only [1] mem is supported for now"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment