diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-17 02:31:46 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-17 02:44:07 +0900 |
| commit | 9a1f8e129fe0f9919981b8a1d345a9b455bd76de (patch) | |
| tree | e52f33a3908c256aebb30f059cabd40f371a886f /system/tmpfiles.go | |
| parent | ee108603572101ad3c285830e04ee248916b6c5d (diff) | |
sandbox: wrap fmsg interface
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/tmpfiles.go')
| -rw-r--r-- | system/tmpfiles.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/system/tmpfiles.go b/system/tmpfiles.go index 636943bc..6ed6e053 100644 --- a/system/tmpfiles.go +++ b/system/tmpfiles.go @@ -31,8 +31,8 @@ type Tmpfile struct { } func (t *Tmpfile) Type() Enablement { return Process } -func (t *Tmpfile) apply(sys *I) error { - sys.println("copying", t) +func (t *Tmpfile) apply(*I) error { + msg.Verbose("copying", t) if t.payload == nil { // this is a misuse of the API; do not return an error message @@ -40,25 +40,25 @@ func (t *Tmpfile) apply(sys *I) error { } if b, err := os.Stat(t.src); err != nil { - return sys.wrapErrSuffix(err, + return wrapErrSuffix(err, fmt.Sprintf("cannot stat %q:", t.src)) } else { if b.IsDir() { - return sys.wrapErrSuffix(syscall.EISDIR, + return wrapErrSuffix(syscall.EISDIR, fmt.Sprintf("%q is a directory", t.src)) } if s := b.Size(); s > t.n { - return sys.wrapErrSuffix(syscall.ENOMEM, + return wrapErrSuffix(syscall.ENOMEM, fmt.Sprintf("file %q is too long: %d > %d", t.src, s, t.n)) } } if f, err := os.Open(t.src); err != nil { - return sys.wrapErrSuffix(err, + return wrapErrSuffix(err, fmt.Sprintf("cannot open %q:", t.src)) } else if _, err = io.CopyN(t.buf, f, t.n); err != nil { - return sys.wrapErrSuffix(err, + return wrapErrSuffix(err, fmt.Sprintf("cannot read from %q:", t.src)) } |
