diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-18 22:30:34 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-18 22:30:34 +0900 |
| commit | 140fe212370b99c8430bdf04155479bdc16c9ee8 (patch) | |
| tree | f1f277d9b1b6b12c82e27b893b030d8725a91286 /container/params.go | |
| parent | f52d2c7db6e2a599553ece9536b12abeccd88c0d (diff) | |
container/params: check setup/receive behaviour
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/params.go')
| -rw-r--r-- | container/params.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/container/params.go b/container/params.go index a5b4f2f1..09be3707 100644 --- a/container/params.go +++ b/container/params.go @@ -9,7 +9,8 @@ import ( ) var ( - ErrNotSet = errors.New("environment variable not set") + ErrNotSet = errors.New("environment variable not set") + ErrFdFormat = errors.New("bad file descriptor representation") ) // Setup appends the read end of a pipe for setup params transmission and returns its fd. @@ -31,7 +32,7 @@ func Receive(key string, e any, v **os.File) (func() error, error) { return nil, ErrNotSet } else { if fd, err := strconv.Atoi(s); err != nil { - return nil, err + return nil, ErrFdFormat } else { setup = os.NewFile(uintptr(fd), "setup") if setup == nil { |
