From 92fc5f1b278024f75fc9178b59ea406cb8048816 Mon Sep 17 00:00:00 2001 From: Yohei Ueda Date: Thu, 23 Oct 2014 07:06:09 +0900 Subject: [PATCH] Fix an endian bug for the ioctl argument Signed-off-by: Yohei Ueda --- console/console.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/console.go b/console/console.go index 346f537d..438e6704 100644 --- a/console/console.go +++ b/console/console.go @@ -67,14 +67,14 @@ func OpenAndDup(consolePath string) error { // Unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. // Unlockpt should be called before opening the slave side of a pseudoterminal. func Unlockpt(f *os.File) error { - var u int + var u int32 return Ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) } // Ptsname retrieves the name of the first available pts for the given master. func Ptsname(f *os.File) (string, error) { - var n int + var n int32 if err := Ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil { return "", err