try to fix darwin pty

This commit is contained in:
Liam Galvin 2018-08-13 17:41:25 +01:00
parent 8daef05920
commit 70fbefc530
1 changed files with 1 additions and 2 deletions

View File

@ -50,8 +50,7 @@ func getpt() (file *os.File, err error) {
func ptsname(file *os.File) (name string, err error) {
n := make([]byte, (syscall.TIOCPTYGNAME>>16)&((1<<13)-1))
var err error
n, err = ioctl(file, syscall.TIOCPTYGNAME, uintptr(unsafe.Pointer(&n[0])))
_, err = ioctl(file, syscall.TIOCPTYGNAME, uintptr(unsafe.Pointer(&n[0])))
for i, c := range n {
if c == 0 {
return string(n[:i]), nil