From 181f750d53b30a81ec480d9c76b08e7f43b7fdd6 Mon Sep 17 00:00:00 2001 From: Gaku Yasui Date: Fri, 26 Sep 2025 19:46:03 +0900 Subject: [PATCH] fix: TIOCSSERIAL ioctl pointer argument (remove extra &) --- serial_setserial_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serial_setserial_linux.go b/serial_setserial_linux.go index c142dc1..5c9b125 100644 --- a/serial_setserial_linux.go +++ b/serial_setserial_linux.go @@ -26,8 +26,9 @@ func (port *unixPort) SetSerialPortMode(portMode uint32) error { if err != nil { return err } + ser.Port = portMode - _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(port.handle), unix.TIOCSSERIAL, uintptr(unsafe.Pointer(&ser))) + _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(port.handle), unix.TIOCSSERIAL, uintptr(unsafe.Pointer(ser))) if errno != 0 { return fmt.Errorf("ioctl TIOCSSERIAL failed: %v", errno) }