Skip to content

Commit 4f23f80

Browse files
committed
windows: change Signal to alias syscall.Signal
This CL changes Signal type from int to alias syscall.Signal to make Signal useful. In particular, you can pass windows.SIGINT to signal.Notify to produce behaviour similar to os.Interrupt and syscall.SIGINT. For golang/go#77076. Change-Id: Ie9243c30063e777f9898eba6d649c248a7f48fc5 Reviewed-on: https://go-review.googlesource.com/c/sys/+/735920 Reviewed-by: Quim Muntal <quimmuntal@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com>
1 parent 7548802 commit 4f23f80

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

windows/aliases.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ package windows
88

99
import "syscall"
1010

11+
type Signal = syscall.Signal
1112
type Errno = syscall.Errno
1213
type SysProcAttr = syscall.SysProcAttr

windows/syscall_windows.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,20 +1490,6 @@ func Getgid() (gid int) { return -1 }
14901490
func Getegid() (egid int) { return -1 }
14911491
func Getgroups() (gids []int, err error) { return nil, syscall.EWINDOWS }
14921492

1493-
type Signal int
1494-
1495-
func (s Signal) Signal() {}
1496-
1497-
func (s Signal) String() string {
1498-
if 0 <= s && int(s) < len(signals) {
1499-
str := signals[s]
1500-
if str != "" {
1501-
return str
1502-
}
1503-
}
1504-
return "signal " + itoa(int(s))
1505-
}
1506-
15071493
func LoadCreateSymbolicLink() error {
15081494
return procCreateSymbolicLinkW.Find()
15091495
}

0 commit comments

Comments
 (0)