fmsg: implement suspend in writer
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -36,18 +36,18 @@ func (a *ACL) Type() Enablement {
|
||||
}
|
||||
|
||||
func (a *ACL) apply(sys *I) error {
|
||||
fmsg.VPrintln("applying ACL", a)
|
||||
fmsg.Verbose("applying ACL", a)
|
||||
return fmsg.WrapErrorSuffix(acl.UpdatePerm(a.path, sys.uid, a.perms...),
|
||||
fmt.Sprintf("cannot apply ACL entry to %q:", a.path))
|
||||
}
|
||||
|
||||
func (a *ACL) revert(sys *I, ec *Criteria) error {
|
||||
if ec.hasType(a) {
|
||||
fmsg.VPrintln("stripping ACL", a)
|
||||
fmsg.Verbose("stripping ACL", a)
|
||||
return fmsg.WrapErrorSuffix(acl.UpdatePerm(a.path, sys.uid),
|
||||
fmt.Sprintf("cannot strip ACL entry from %q:", a.path))
|
||||
} else {
|
||||
fmsg.VPrintln("skipping ACL", a)
|
||||
fmsg.Verbose("skipping ACL", a)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user