Skip to content

Commit

Permalink
fix aix compile error (#144)
Browse files Browse the repository at this point in the history
* Fix windows compilation

* Fix compilation for AIX. Relates to #139

* Remove unused import for windows
  • Loading branch information
creack committed Mar 27, 2022
1 parent 6eb8749 commit d301b27
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ioctl.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !windows && !solaris
// +build !windows,!solaris
//go:build !windows && !solaris && !aix
// +build !windows,!solaris,!aix

package pty

Expand Down
13 changes: 13 additions & 0 deletions ioctl_unsupported.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build aix
// +build aix

package pty

const (
TIOCGWINSZ = 0
TIOCSWINSZ = 0
)

func ioctl(fd, cmd, ptr uintptr) error {
return ErrUnsupported
}
3 changes: 1 addition & 2 deletions start_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package pty

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

0 comments on commit d301b27

Please sign in to comment.