linux/std: handle fsu exit status 1
All checks were successful
Tests / Go tests (push) Successful in 34s
Nix / NixOS tests (push) Successful in 2m27s

Printing "exit status 1" is confusing. This handles the ExitError and returns EACCES instead.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-01-01 21:34:57 +09:00
parent 35b7142317
commit 6acd0d4e88
5 changed files with 36 additions and 16 deletions

View File

@@ -20,7 +20,7 @@ func printShowSystem(short bool) {
info := new(fst.Info)
// get fid by querying uid of aid 0
if uid, err := os.Uid(0); err != nil {
if uid, err := sys.Uid(0); err != nil {
fmsg.Fatalf("cannot obtain uid from fsu: %v", err)
} else {
info.User = (uid / 10000) - 100
@@ -194,7 +194,7 @@ func printPs(short bool) {
now := time.Now().UTC()
var entries state.Entries
s := state.NewMulti(os.Paths().RunDirPath)
s := state.NewMulti(sys.Paths().RunDirPath)
if e, err := state.Join(s); err != nil {
fmsg.Fatalf("cannot join store: %v", err)
} else {