]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add dummy SIGTERM constant to js/wasm
authorRichard Musiol <mail@richard-musiol.de>
Tue, 20 Nov 2018 15:37:50 +0000 (16:37 +0100)
committerRichard Musiol <neelance@gmail.com>
Tue, 20 Nov 2018 16:17:17 +0000 (16:17 +0000)
The js/wasm architecture does not support signals at all, but there are
already some signal constants defined because of stdlib dependencies.
This change adds a dummy constant for syscall.SIGTERM as well, to make
js/wasm compatible with more existing Go code.

There is the Go proverb "Syscall must always be guarded with build
tags.", so code should not expect syscall.SIGTERM to exist. Still,
adding SIGTERM should do more good than harm.

Fixes #28719.

Change-Id: I3554b484f96a21427491c04eb1dd57e7af5bd62f
Reviewed-on: https://go-review.googlesource.com/c/150477
Run-TryBot: Richard Musiol <neelance@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/syscall/syscall_js.go

index 6822eec8359cabdaefc26c96dbf1f8b8ad3c856d..2e1a9ec9f1fef01cdd7019844986a1f153577a66 100644 (file)
@@ -74,6 +74,7 @@ const (
        SIGKILL
        SIGTRAP
        SIGQUIT
+       SIGTERM
 )
 
 func (s Signal) Signal() {}