Skip to content

Commit d301b27

Browse files
authored
fix aix compile error (#144)
* Fix windows compilation * Fix compilation for AIX. Relates to #139 * Remove unused import for windows
1 parent 6eb8749 commit d301b27

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

ioctl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build !windows && !solaris
2-
// +build !windows,!solaris
1+
//go:build !windows && !solaris && !aix
2+
// +build !windows,!solaris,!aix
33

44
package pty
55

ioctl_unsupported.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//go:build aix
2+
// +build aix
3+
4+
package pty
5+
6+
const (
7+
TIOCGWINSZ = 0
8+
TIOCSWINSZ = 0
9+
)
10+
11+
func ioctl(fd, cmd, ptr uintptr) error {
12+
return ErrUnsupported
13+
}

start_windows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package pty
55

66
import (
7-
"errors"
87
"os"
98
"os/exec"
109
)
@@ -16,5 +15,5 @@ import (
1615
// This will resize the pty to the specified size before starting the command.
1716
// Starts the process in a new session and sets the controlling terminal.
1817
func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
19-
return nil, errors.New("unsupported platform")
18+
return nil, ErrUnsupported
2019
}

0 commit comments

Comments
 (0)