From 926893f68cc9234080079d8b07b1eabe97dee290 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Tue, 7 Mar 2023 13:58:46 -0500 Subject: [PATCH] libtailscale: take a C.int, not a Go int This was compiling because of the implicit integer conversion on the C side. But -1 was becoming INT32MAX. Which was an invalid fd, so the logs were hidden just as if the fd were -1. But it filled strace with EBADF. Signed-off-by: David Crawshaw --- tailscale.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tailscale.go b/tailscale.go index 4a7b8a8..83dd712 100644 --- a/tailscale.go +++ b/tailscale.go @@ -349,7 +349,7 @@ func TsnetSetEphemeral(sd C.int, e int) C.int { } //export TsnetSetLogFD -func TsnetSetLogFD(sd C.int, fd int) C.int { +func TsnetSetLogFD(sd, fd C.int) C.int { s, err := getServer(sd) if err != nil { return s.recErr(err)