container/params: remove confusingly named error
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m9s
Test / Hakurei (push) Successful in 2m59s
Test / Hpkg (push) Successful in 3m53s
Test / Flake checks (push) Successful in 1m19s
Test / Sandbox (race detector) (push) Successful in 4m16s
Test / Hakurei (race detector) (push) Successful in 4m49s
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m9s
Test / Hakurei (push) Successful in 2m59s
Test / Hpkg (push) Successful in 3m53s
Test / Flake checks (push) Successful in 1m19s
Test / Sandbox (race detector) (push) Successful in 4m16s
Test / Hakurei (race detector) (push) Successful in 4m49s
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
edd6f2cfa9
commit
82608164f6
@ -62,7 +62,7 @@ func Init(prepare func(prefix string), setVerbose func(verbose bool)) {
|
|||||||
offsetSetup int
|
offsetSetup int
|
||||||
)
|
)
|
||||||
if f, err := Receive(setupEnv, ¶ms, &setupFile); err != nil {
|
if f, err := Receive(setupEnv, ¶ms, &setupFile); err != nil {
|
||||||
if errors.Is(err, ErrInvalid) {
|
if errors.Is(err, EBADF) {
|
||||||
log.Fatal("invalid setup descriptor")
|
log.Fatal("invalid setup descriptor")
|
||||||
}
|
}
|
||||||
if errors.Is(err, ErrNotSet) {
|
if errors.Is(err, ErrNotSet) {
|
||||||
|
@ -5,11 +5,11 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrNotSet = errors.New("environment variable not set")
|
ErrNotSet = errors.New("environment variable not set")
|
||||||
ErrInvalid = errors.New("bad file descriptor")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Setup appends the read end of a pipe for setup params transmission and returns its fd.
|
// Setup appends the read end of a pipe for setup params transmission and returns its fd.
|
||||||
@ -35,7 +35,7 @@ func Receive(key string, e any, v **os.File) (func() error, error) {
|
|||||||
} else {
|
} else {
|
||||||
setup = os.NewFile(uintptr(fd), "setup")
|
setup = os.NewFile(uintptr(fd), "setup")
|
||||||
if setup == nil {
|
if setup == nil {
|
||||||
return nil, ErrInvalid
|
return nil, syscall.EBADF
|
||||||
}
|
}
|
||||||
if v != nil {
|
if v != nil {
|
||||||
*v = setup
|
*v = setup
|
||||||
|
@ -64,7 +64,7 @@ func ShimMain() {
|
|||||||
closeSetup func() error
|
closeSetup func() error
|
||||||
)
|
)
|
||||||
if f, err := container.Receive(shimEnv, ¶ms, nil); err != nil {
|
if f, err := container.Receive(shimEnv, ¶ms, nil); err != nil {
|
||||||
if errors.Is(err, container.ErrInvalid) {
|
if errors.Is(err, syscall.EBADF) {
|
||||||
log.Fatal("invalid config descriptor")
|
log.Fatal("invalid config descriptor")
|
||||||
}
|
}
|
||||||
if errors.Is(err, container.ErrNotSet) {
|
if errors.Is(err, container.ErrNotSet) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user