From ec0cd60fc3a977a80a2b805c20b9a3ec667a5bc4 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 6 Apr 2020 20:11:24 -0700 Subject: [PATCH] portlist: fail earlier, more nicely on iOS --- portlist/poller.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/portlist/poller.go b/portlist/poller.go index 5dd21476e..e950bb596 100644 --- a/portlist/poller.go +++ b/portlist/poller.go @@ -6,7 +6,11 @@ package portlist import ( "context" + "errors" + "runtime" "time" + + "tailscale.com/version" ) // Poller scans the systems for listening ports periodically and sends @@ -28,8 +32,11 @@ type Poller struct { } // NewPoller returns a new portlist Poller. It returns an error -// if the portlist couldn't be obtained. Subsequent +// if the portlist couldn't be obtained. func NewPoller() (*Poller, error) { + if runtime.GOOS == "darwin" && version.IsMobile() { + return nil, errors.New("not available on iOS") + } p := &Poller{ c: make(chan List), quitCh: make(chan struct{}),