Skip to content

Commit

Permalink
fixed type issue from recent merge
Browse files Browse the repository at this point in the history
  • Loading branch information
photostorm committed Oct 28, 2023
1 parent 84a9155 commit 0ff5399
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/creack/pty/v2

go 1.18

require golang.org/x/sys v0.13.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20220721230656-c6bc011c0c49 h1:TMjZDarEwf621XDryfitp/8awEhiZNiwgphKlTMGRIg=
golang.org/x/sys v0.0.0-20220721230656-c6bc011c0c49/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5 changes: 3 additions & 2 deletions winsize_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
package pty

import (
"os"
"syscall"
"unsafe"
)

// Setsize resizes t to s.
func Setsize(t FdHolder, ws *Winsize) error {
//nolint:gosec // Expected unsafe pointer for Syscall call.
return ioctl(t, syscall.TIOCSWINSZ, uintptr(unsafe.Pointer(ws)))
return ioctl(t.(*os.File), syscall.TIOCSWINSZ, uintptr(unsafe.Pointer(ws)))
}

// GetsizeFull returns the full terminal size description.
func GetsizeFull(t FdHolder) (size *Winsize, err error) {
var ws Winsize

//nolint:gosec // Expected unsafe pointer for Syscall call.
if err := ioctl(t, syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&ws))); err != nil {
if err := ioctl(t.(*os.File), syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&ws))); err != nil {
return nil, err
}
return &ws, nil
Expand Down

0 comments on commit 0ff5399

Please sign in to comment.