mirror of
https://github.com/creack/pty.git
synced 2026-03-31 18:47:10 +09:00
Restore support for older Go versions
When compiled with go older than 1.12 creack/pty will not include a fix for blocking Read() and will be prone to data races - but at least it will work For more information see issues: #88 #114 #156 #162
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
//go:build go1.12
|
||||
// +build go1.12
|
||||
|
||||
package pty
|
||||
|
||||
import (
|
||||
|
||||
5
ioctl.go
5
ioctl.go
@@ -1,7 +1,6 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
//go:build !windows && go1.12
|
||||
// +build !windows,go1.12
|
||||
|
||||
//
|
||||
package pty
|
||||
|
||||
import "os"
|
||||
|
||||
10
ioctl_legacy.go
Normal file
10
ioctl_legacy.go
Normal file
@@ -0,0 +1,10 @@
|
||||
//go:build !windows && !go1.12
|
||||
// +build !windows,!go1.12
|
||||
|
||||
package pty
|
||||
|
||||
import "os"
|
||||
|
||||
func ioctl(f *os.File, cmd, ptr uintptr) error {
|
||||
return ioctl_inner(f.Fd(), cmd, ptr) // fall back to blocking io (old behavior)
|
||||
}
|
||||
Reference in New Issue
Block a user