diff options
| author | Antonio Huete Jimenez <tuxillo@quantumachine.net> | 2020-10-28 11:44:26 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2020-10-28 17:08:06 +0000 |
| commit | e3c58bbeb8c76fa3abc0f7153edbab72208c1f88 (patch) | |
| tree | b2ed29a08bd5831866731d0817caa216980d1f91 /src/os/executable_procfs.go | |
| parent | d4c1ad882973e407ff85b977f4ce5b9435451190 (diff) | |
| download | go-e3c58bbeb8c76fa3abc0f7153edbab72208c1f88.tar.xz | |
os: do not use procfs for os.Executable in dragonfly
procfs(5) is not always mounted in DragonFly BSD, for example during
the binary package build with synth. os.Executable() consumers
will then fail, we've spotted this when trying to build tinygo:
[...]
copying source files
./build/tinygo build-builtins -target=armv6m-none-eabi [...]
panic: could not get executable path: readlink /proc/curproc/file:
no such file or directory
[...]
Use KERN_PROC_PATHNAME as FreeBSD does.
Change-Id: Ic65bea02cd0309fb24dec8ba8d2b151d1acde67b
GitHub-Last-Rev: 083120a43b3158bb45d7e1a66fa32e3335a2d407
GitHub-Pull-Request: golang/go#36826
Reviewed-on: https://go-review.googlesource.com/c/go/+/216622
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/os/executable_procfs.go')
| -rw-r--r-- | src/os/executable_procfs.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/os/executable_procfs.go b/src/os/executable_procfs.go index 2628223b8d..5ee41a4b2e 100644 --- a/src/os/executable_procfs.go +++ b/src/os/executable_procfs.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux netbsd dragonfly js,wasm +// +build linux netbsd js,wasm package os @@ -23,8 +23,6 @@ var executablePath, executablePathErr = func() (string, error) { procfn = "/proc/self/exe" case "netbsd": procfn = "/proc/curproc/exe" - case "dragonfly": - procfn = "/proc/curproc/file" } return Readlink(procfn) }() |
