wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* [PATCH wireguard-go] tun: make operateonfd.go build tags more specific
@ 2021-09-23 10:07 Tobias Klauser
  2021-09-23 15:54 ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Klauser @ 2021-09-23 10:07 UTC (permalink / raw)
  To: wireguard

(*NativeTun).operateOnFd is only used on darwin and freebsd. Adjust the
build tags accordingly.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 tun/operateonfd.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tun/operateonfd.go b/tun/operateonfd.go
index aab71161f27c..bc804539169f 100644
--- a/tun/operateonfd.go
+++ b/tun/operateonfd.go
@@ -1,5 +1,5 @@
-//go:build !windows
-// +build !windows
+//go:build darwin || freebsd
+// +build darwin freebsd
 
 /* SPDX-License-Identifier: MIT
  *
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH wireguard-go] tun: make operateonfd.go build tags more specific
  2021-09-23 10:07 [PATCH wireguard-go] tun: make operateonfd.go build tags more specific Tobias Klauser
@ 2021-09-23 15:54 ` Jason A. Donenfeld
  2021-09-24  8:40   ` Tobias Klauser
  0 siblings, 1 reply; 3+ messages in thread
From: Jason A. Donenfeld @ 2021-09-23 15:54 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: WireGuard mailing list

I've applied this. Thanks for the patch. Though I do wonder: it's
functionally the same as before, right? What instances lead to this
being an issue? Or did this way just seem more correct?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH wireguard-go] tun: make operateonfd.go build tags more specific
  2021-09-23 15:54 ` Jason A. Donenfeld
@ 2021-09-24  8:40   ` Tobias Klauser
  0 siblings, 0 replies; 3+ messages in thread
From: Tobias Klauser @ 2021-09-24  8:40 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: WireGuard mailing list

On 2021-09-23 at 17:54:59 +0200, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> I've applied this. Thanks for the patch. Though I do wonder: it's
> functionally the same as before, right? What instances lead to this
> being an issue? Or did this way just seem more correct?

Thanks. Functionally it's the same, yes. I noticed this when running
staticcheck against wireguard-go on Linux and it reported
(*NativeTun).operateOnFd as being defined but not used. So it just
seemed more correct to only define it for platforms that actually use
it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-24  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 10:07 [PATCH wireguard-go] tun: make operateonfd.go build tags more specific Tobias Klauser
2021-09-23 15:54 ` Jason A. Donenfeld
2021-09-24  8:40   ` Tobias Klauser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).