diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-01 18:10:32 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-01 18:10:32 +0000 |
commit | 7aaca21b706bb79c1bc5eee986009b8fae2af7cf (patch) | |
tree | a3df1462b55a851ff7f2efe3b2555fe8cd4c91bb /pkg/safecopy/safecopy_unsafe.go | |
parent | 7ac96cd64fb4f93f66bdbb70676e37e60bd8061e (diff) | |
parent | 4e6a1a5adb5607423c180089d8b464ef7dfdd1ae (diff) |
Merge release-20200323.0-49-g4e6a1a5 (automated)
Diffstat (limited to 'pkg/safecopy/safecopy_unsafe.go')
-rwxr-xr-x | pkg/safecopy/safecopy_unsafe.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/safecopy/safecopy_unsafe.go b/pkg/safecopy/safecopy_unsafe.go index b15b920fe..41dd567f3 100755 --- a/pkg/safecopy/safecopy_unsafe.go +++ b/pkg/safecopy/safecopy_unsafe.go @@ -324,13 +324,11 @@ func errorFromFaultSignal(addr uintptr, sig int32) error { // // It stores the value of the previously set handler in previous. // -// The extraMask parameter is OR'ed into the existing signal handler mask. -// // This function will be called on initialization in order to install safecopy // handlers for appropriate signals. These handlers will call the previous // handler however, and if this is function is being used externally then the // same courtesy is expected. -func ReplaceSignalHandler(sig syscall.Signal, handler uintptr, previous *uintptr, extraMask uint64) error { +func ReplaceSignalHandler(sig syscall.Signal, handler uintptr, previous *uintptr) error { var sa struct { handler uintptr flags uint64 @@ -350,10 +348,10 @@ func ReplaceSignalHandler(sig syscall.Signal, handler uintptr, previous *uintptr if sa.handler == 0 { return fmt.Errorf("previous handler for signal %x isn't set", sig) } + *previous = sa.handler // Install our own handler. - sa.mask |= extraMask sa.handler = handler if _, _, e := syscall.RawSyscall6(syscall.SYS_RT_SIGACTION, uintptr(sig), uintptr(unsafe.Pointer(&sa)), 0, maskLen, 0, 0); e != 0 { return e |