diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-16 17:26:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-16 18:51:53 +0900 |
| commit | e599b5583dd821ed26bdfc01f7f67d4a317b9843 (patch) | |
| tree | b444a3dc964814360e6779bc10b30f2e599b537c /internal/system/wayland.go | |
| parent | 33a4ab11c226c736c0d8b2644fbbe27a5ca045e9 (diff) | |
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>
Diffstat (limited to 'internal/system/wayland.go')
| -rw-r--r-- | internal/system/wayland.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/system/wayland.go b/internal/system/wayland.go index 9646b467..ac3634ae 100644 --- a/internal/system/wayland.go +++ b/internal/system/wayland.go @@ -45,7 +45,7 @@ func (w Wayland) apply(sys *I) error { return fmsg.WrapErrorSuffix(err, fmt.Sprintf("cannot attach to wayland on %q:", w.pair[1])) } else { - fmsg.VPrintf("wayland attached on %q", w.pair[1]) + fmsg.Verbosef("wayland attached on %q", w.pair[1]) } if sp, err := w.conn.Bind(w.pair[0], w.appID, w.instanceID); err != nil { @@ -53,7 +53,7 @@ func (w Wayland) apply(sys *I) error { fmt.Sprintf("cannot bind to socket on %q:", w.pair[0])) } else { sys.sp = sp - fmsg.VPrintf("wayland listening on %q", w.pair[0]) + fmsg.Verbosef("wayland listening on %q", w.pair[0]) return fmsg.WrapErrorSuffix(errors.Join(os.Chmod(w.pair[0], 0), acl.UpdatePerm(w.pair[0], sys.uid, acl.Read, acl.Write, acl.Execute)), fmt.Sprintf("cannot chmod socket on %q:", w.pair[0])) } @@ -61,16 +61,16 @@ func (w Wayland) apply(sys *I) error { func (w Wayland) revert(_ *I, ec *Criteria) error { if ec.hasType(w) { - fmsg.VPrintf("removing wayland socket on %q", w.pair[0]) + fmsg.Verbosef("removing wayland socket on %q", w.pair[0]) if err := os.Remove(w.pair[0]); err != nil && !errors.Is(err, os.ErrNotExist) { return err } - fmsg.VPrintf("detaching from wayland on %q", w.pair[1]) + fmsg.Verbosef("detaching from wayland on %q", w.pair[1]) return fmsg.WrapErrorSuffix(w.conn.Close(), fmt.Sprintf("cannot detach from wayland on %q:", w.pair[1])) } else { - fmsg.VPrintf("skipping wayland cleanup on %q", w.pair[0]) + fmsg.Verbosef("skipping wayland cleanup on %q", w.pair[0]) return nil } } |
