Ophestra
7baca66a56
This is no longer needed since shim and init are now part of the main program. Signed-off-by: Ophestra <cat@gensokyo.uk>
27 lines
397 B
Go
27 lines
397 B
Go
package proc
|
|
|
|
import (
|
|
"os"
|
|
"sync"
|
|
|
|
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
|
)
|
|
|
|
var (
|
|
executable string
|
|
executableOnce sync.Once
|
|
)
|
|
|
|
func copyExecutable() {
|
|
if name, err := os.Executable(); err != nil {
|
|
fmsg.Fatalf("cannot read executable path: %v", err)
|
|
} else {
|
|
executable = name
|
|
}
|
|
}
|
|
|
|
func MustExecutable() string {
|
|
executableOnce.Do(copyExecutable)
|
|
return executable
|
|
}
|