[lxc-devel] [lxd/master] shared/log15: Fix due to recent unix change

stgraber on Github lxc-bot at linuxcontainers.org
Fri Aug 28 15:27:45 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200828/d1ff8477/attachment.bin>
-------------- next part --------------
From 4a25da23b978d2eacb145d710a9682cc12b74f88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 28 Aug 2020 11:24:29 -0400
Subject: [PATCH] shared/log15: Fix due to recent unix change
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 shared/log15/term/terminal_notwindows.go | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/shared/log15/term/terminal_notwindows.go b/shared/log15/term/terminal_notwindows.go
index 56f6992a07..55ad733187 100644
--- a/shared/log15/term/terminal_notwindows.go
+++ b/shared/log15/term/terminal_notwindows.go
@@ -8,14 +8,11 @@
 package term
 
 import (
-	"unsafe"
-
 	"golang.org/x/sys/unix"
 )
 
 // IsTty returns true if the given file descriptor is a terminal.
 func IsTty(fd uintptr) bool {
-	var termios Termios
-	_, _, err := unix.Syscall6(unix.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
-	return err == 0
+	_, err := unix.IoctlGetTermios(int(fd), ioctlReadTermios)
+	return err == nil
 }


More information about the lxc-devel mailing list